/* ─────────────────────────────────────────────────────────────────────
   Bing Bong shared web styles. Used by:
     - public/index.html      (preview)
     - public/create.html     (soundpack editor)
     - public/samples.html    (sample soundpack browser)

   Page-specific tweaks should live in a small inline <style> block on
   that page rather than growing this file with one-offs.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --bg: #1a1028; /* background — deep plum-black */
  --surface: #241634; /* lifted plum */
  --surface-light: #2e1d40; /* pressed/hover */
  --dark-card: #0f0a1f; /* deepest surface / shadow colour */
  --text-primary: #f5f1f8;
  --text-secondary: #8a7fa0;
  --text-tertiary: rgba(138, 127, 160, 0.55);
  --primary: #ff4f8b; /* hot pink — brand */
  --accent: #ff4f8b;
  --accent-orange: #ffa987;
  --accent-yellow: #ffc98a;
  --danger: #f43f5e;
  --shadow: #0f0a1f;
  --border: rgba(245, 241, 248, 0.08);
  --border-strong: rgba(245, 241, 248, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Baloo 2", "Comfortaa", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Site nav (shared header on every page) ───────────────────────── */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
}

.site-nav-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}
.site-nav-brand .bing {
  color: var(--text-primary);
}
.site-nav-brand .bong {
  color: var(--primary);
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.site-nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-light);
}
.site-nav-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}
.site-nav-link.active:hover {
  color: #fff;
  background: var(--primary);
}

/* Site-nav narrow-screen rules now live in the mobile-polish block at
   the bottom of this file (≤720px tightens, ≤420px stacks). */

/* ── Top nav (legacy, kept for create.html/samples.html secondary nav) */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.top-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: color 0.15s ease;
}
.top-nav a:hover {
  color: var(--text-primary);
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.logo {
  font-size: 60px;
  font-weight: 900;
  letter-spacing: -2px;
  margin: 0 0 16px;
  line-height: 1;
}
.logo .bing {
  color: var(--text-primary);
}
.logo .bong {
  color: var(--primary);
}

.tagline {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0 auto 28px;
  max-width: 520px;
  line-height: 1.5;
}

/* ── Sticker card (chunky drop-shadow) ─────────────────────────────── */
.sticker {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
}

/* ── Section card (used by create + samples) ───────────────────────── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 22px;
  margin-top: 24px;
}

/* ── Store badges ──────────────────────────────────────────────────── */
.store-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}
.store-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.store-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.store-btn svg {
  width: 22px;
  height: 22px;
}
.store-btn small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

/* ── Drop zone (preview page) ──────────────────────────────────────── */
.drop-zone {
  margin-top: 48px;
  background: var(--surface);
  border: 3px dashed var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 48px 24px;
  text-align: center;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.15s ease;
  cursor: pointer;
}
.drop-zone:hover,
.drop-zone.dragging {
  background: var(--surface-light);
  border-color: var(--primary);
}
.drop-zone .icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.drop-zone h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.3px;
}
.drop-zone p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.pick-btn {
  margin-top: 20px;
  display: inline-block;
  padding: 12px 22px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.15s ease;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 3px 3px 0 var(--shadow);
}
.btn-secondary {
  background: var(--surface-light);
  color: var(--text-primary);
}

/* Row of sticker links on the home page (Create / Browse samples). */
.sticker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* Inline sticker-style link used to nav between pages on home. */
.sticker-link {
  display: inline-block;
  padding: 12px 22px;
  background: var(--surface);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}
.sticker-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.sticker-link:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

/* ── Preview (drop a .bingbong file) ───────────────────────────────── */
.preview {
  margin-top: 40px;
  display: none;
}
.preview.visible {
  display: block;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.group-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--shadow);
  margin-bottom: 24px;
}

.group-emoji {
  font-size: 40px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.group-info h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
}

.group-info .meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  padding-top: 4px;
}

.sound-card {
  aspect-ratio: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}
.sound-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}
.sound-card.playing,
.sound-card:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.sound-card .sound-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--card-color);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.sound-card .sound-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.sound-card .play-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-color);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sound-card:hover .play-indicator,
.sound-card.playing .play-indicator {
  opacity: 1;
}
.play-indicator svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

/* ── Errors ────────────────────────────────────────────────────────── */
.error {
  margin-top: 24px;
  padding: 16px;
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  color: #ffb4c0;
  font-size: 13px;
  font-weight: 700;
  display: none;
}
.error.visible {
  display: block;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  margin-top: 64px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}

/* ─── Editor (create.html) ─────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

input[type="text"],
input[type="color"] {
  font-family: inherit;
}

.text-input {
  width: 100%;
  background: var(--dark-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}
.text-input:focus {
  border-color: var(--primary);
}

.file-suffix {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

.upload-card .upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.upload-card .upload-text {
  flex: 1;
  min-width: 0;
}
.upload-card .upload-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.4;
}
.loaded-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  background: rgba(255, 79, 139, 0.15);
  border: 1px solid rgba(255, 79, 139, 0.4);
  border-radius: 999px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  vertical-align: middle;
}
.upload-card.dragging {
  background: var(--surface-light);
  border-color: var(--primary);
}

.group-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.sound-row {
  background: var(--surface-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.row-header .row-num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.row-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.row-remove:hover {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
}

.row-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: stretch;
}

.icon-button {
  height: 52px;
  background: var(--dark-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: var(--text-primary);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.icon-button:hover {
  border-color: var(--primary);
}

.colors-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  border: none;
  padding: 0;
  background-clip: padding-box;
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease;
  position: relative;
}
.color-swatch:hover {
  transform: scale(1.08);
}
.color-swatch.selected {
  box-shadow: 0 0 0 2.5px var(--text-primary);
}
.color-swatch.rainbow {
  background: conic-gradient(
    from 0deg,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}
.color-swatch.rainbow.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch-active, transparent);
  border: 1.5px solid #fff;
  transform: translate(-50%, -50%);
}

.audio-pill {
  flex: 1;
  background: var(--dark-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.audio-pill:hover {
  border-color: var(--primary);
}
.audio-pill.has-file {
  color: var(--text-primary);
  border-color: var(--primary);
}
.audio-pill .audio-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.play-btn.visible {
  display: inline-flex;
}
.play-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.add-row-btn {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  background: var(--surface-light);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.add-row-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ─── Page-level drag overlay ──────────────────────────────────────── */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 31, 0.78);
  border: 4px dashed var(--primary);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.drop-overlay.visible {
  display: flex;
}
.drop-overlay-card {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  text-align: center;
  box-shadow: 5px 5px 0 var(--shadow);
}
.drop-overlay-card .icon {
  font-size: 56px;
  margin-bottom: 8px;
}
.drop-overlay-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
}
.drop-overlay-card p {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
}

/* ─── Emoji popover ────────────────────────────────────────────────── */
.emoji-pop-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 31, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.emoji-pop-backdrop.visible {
  display: flex;
}
.emoji-pop {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 16px;
  width: min(420px, 100%);
  max-height: 70vh;
  overflow-y: auto;
}
.emoji-pop h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
  text-align: center;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.emoji-cell {
  aspect-ratio: 1;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s ease,
    transform 0.08s ease;
}
.emoji-cell:hover {
  background: rgba(255, 79, 139, 0.15);
  transform: scale(1.05);
}
.emoji-custom {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.emoji-custom input {
  flex: 1;
  background: var(--dark-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  outline: none;
}

/* ─── Samples (samples.html) ───────────────────────────────────────── */
.samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.sample-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--shadow);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}
.sample-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.sample-card .sample-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sample-card .sample-emoji {
  font-size: 28px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-color, var(--primary));
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--shadow);
  flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.sample-card .sample-name {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}
.sample-card .sample-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 2px;
}
.sample-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sample-card .sample-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.sample-card .sample-actions .btn {
  flex: 1;
  padding: 11px 14px;
  font-size: 13px;
}

.empty-state {
  margin-top: 24px;
  padding: 36px 24px;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-secondary);
  font-weight: 700;
}
.empty-state .icon {
  font-size: 44px;
  margin-bottom: 10px;
}
.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.empty-state code {
  background: var(--dark-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--text-primary);
}

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .logo {
    font-size: 46px;
  }
  .container {
    padding: 24px 16px 60px;
  }
  .drop-zone {
    padding: 36px 16px;
  }
  .sound-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
  }
  .group-emoji {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }
  .sound-card .sound-icon {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }
  .row-grid {
    grid-template-columns: 52px 1fr;
  }
}

/* ─── Home page (index.html) ───────────────────────────────────────── */

/* Centered single-column hero — used for the personal-letter layout.
   Adds the .centered modifier to the same .home-hero element. */
.home-hero.centered {
  display: block;
  text-align: center;
  padding: 40px 0 32px;
}
.home-hero.centered .logo-xl {
  text-align: center;
  margin: 0 auto 36px;
}

.home-copy {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: left;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.55;
}
.home-copy p {
  margin: 0 0 22px;
}
.home-copy p:last-child {
  margin-bottom: 0;
}

/* Highlighted phrases inside the personal copy. */
.hl-pink {
  color: var(--primary);
  font-weight: 700;
}
.hl-yellow {
  color: #ffde59;
  font-weight: 700;
}
.hl-purple {
  color: #b388ff;
  font-weight: 700;
}

.home-hero.centered .store-row {
  justify-content: center;
  margin: 0 auto;
}

/* Soft horizontal divider used between the hero and the drop section. */
.soft-rule {
  border: 0;
  height: 1px;
  background: var(--border-strong);
  margin: 56px auto 36px;
  max-width: 920px;
  opacity: 0.5;
}

.drop-section {
  margin-top: 4px;
}

.drop-label {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  color: var(--text-secondary);
}

/* Two-column hero: copy + CTA on the left, demo button preview grid
   on the right. Stacks below 760px. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 48px 0 32px;
}

.home-hero-left {
  text-align: left;
}
.home-hero-left .logo-xl {
  margin: 0 0 24px;
  text-align: left;
}
.home-hero-left .tagline-xl {
  margin: 0 0 28px;
  max-width: 460px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}
.home-hero-left .store-row {
  justify-content: flex-start;
  margin-bottom: 18px;
}
.home-hero-left .privacy-line {
  display: inline-flex;
}

/* Demo button grid — mirrors the in-app sound-button look (chunky tile
   with hard drop shadow, big emoji, small label). Read-only preview. */
.home-hero-right {
  display: flex;
  justify-content: center;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 420px;
}
.demo-tile {
  aspect-ratio: 1;
  background: var(--tile, var(--primary));
  border: 2px solid var(--border);
  border-radius: 22px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #1a1028;
  text-align: center;
}
.demo-emoji {
  font-size: 34px;
  line-height: 1;
  margin-top: 6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.demo-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.1px;
  line-height: 1.15;
  margin-bottom: 2px;
}

@media (max-width: 760px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px 0 20px;
  }
  .home-hero-left {
    text-align: center;
  }
  .home-hero-left .logo-xl,
  .home-hero-left .tagline-xl {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
  .home-hero-left .store-row {
    justify-content: center;
  }
  .demo-grid {
    max-width: 360px;
    margin: 0 auto;
  }
}

/* ── Inline word buttons (sound-playing pills inside the home copy) ── */
.word-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  margin: 0 1px;
  font-family: inherit;
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.25;
  color: #f5f1f8;
  background: var(--word-bg, #fff);
  border: none;
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
  vertical-align: baseline;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}
.word-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.word-btn:active,
.word-btn.playing {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.word-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}
.word-btn-icon {
  font-size: 0.8em;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.word-btn--yellow {
  --word-bg: #dcb311;
}
.word-btn--pink {
  --word-bg: #ff8aab;
}
.word-btn--purple {
  --word-bg: #b388ff;
}
.word-btn--green {
  --word-bg: #54e78e;
}

.home-stage {
  position: relative;
  text-align: center;
  padding: 60px 0 28px;
  margin-top: 8px;
}

.logo-xl {
  font-size: clamp(46px, 5vw, 132px);
  font-weight: 800;
  letter-spacing: -5px;
  line-height: 0.92;
  margin: 0 0 24px;
  position: relative;
  z-index: 2;
}
.logo-xl .bing,
.logo-xl .bong {
  position: relative;
  z-index: 2;
}
.logo-xl .bing {
  color: var(--text-primary);
}
.logo-xl .bong {
  color: var(--primary);
}

.tagline-xl {
  font-size: clamp(18px, 1vw, 26px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 auto 36px;
  max-width: 720px;
  line-height: 1.4;
  position: relative;
  z-index: 2;
}
.tagline-xl .bwaap {
  color: var(--accent-yellow);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 24px;
  margin-bottom: 44px;
  position: relative;
  z-index: 2;
}

.store-row {
  display: flex;
  gap: 12px;
}

.store-btn--white {
  background: #fff;
  color: #1a1028;
  border-radius: 14px;
  padding: 10px 18px;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
}
.store-btn--white:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.store-btn--white small {
  color: rgba(15, 10, 31, 0.55);
}

.privacy-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.privacy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6bffa5;
  box-shadow: 0 0 12px rgba(107, 255, 165, 0.6);
}

/* ─── Floating decorative emoji stickers ───────────────────────────── */
.float-sticker {
  position: absolute;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 22px;
  box-shadow: 4px 5px 0 var(--shadow);
  pointer-events: none;
  /* Tucked behind the text so the logo + tagline always sit on top. */
  z-index: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.float-sticker.fs-heart {
  background: #b388ff;
  top: 6%;
  left: 6%;
  transform: rotate(-12deg);
}
.float-sticker.fs-trumpet {
  background: #6bffa5;
  top: 18%;
  right: 6%;
  transform: rotate(10deg);
}
.float-sticker.fs-bell {
  background: #6bb5ff;
  top: 44%;
  left: 4%;
  transform: rotate(-18deg);
}
.float-sticker.fs-coffee {
  background: #ffde59;
  top: 64%;
  left: 4%;
  transform: rotate(8deg);
}
.float-sticker.fs-clown {
  background: #ffa987;
  top: 80%;
  left: 10%;
  transform: rotate(-12deg);
}

/* Sleep sticker lives inside the drop zone, top-right corner. */
.drop-zone-h .fs-sleep {
  background: #ffc1d1;
  position: absolute;
  top: -28px;
  right: -18px;
  transform: rotate(14deg);
  width: 78px;
  height: 78px;
  border-radius: 20px;
  font-size: 32px;
}

/* ─── Drop zone — horizontal layout ────────────────────────────────── */
.drop-zone-h {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
  padding: 22px 26px;
  background: transparent;
  border: 2.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.drop-zone-h:hover,
.drop-zone-h.dragging {
  background: var(--surface-light);
  border-color: var(--primary);
}

.drop-icon-tile {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 3px 3px 0 var(--shadow);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.drop-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.drop-text h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.drop-text p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.drop-cta {
  flex-shrink: 0;
  padding: 14px 22px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.drop-cta:hover {
  background: var(--surface-light);
  border-color: var(--primary);
}

/* ─── Brand footer ─────────────────────────────────────────────────── */
.brand-footer {
  text-align: center;
  margin-top: 56px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}
.brand-footer .name {
  color: var(--primary);
}
.brand-footer-heart {
  display: inline-block;
  margin-left: 4px;
}

/* Hide the floating clown / coffee stickers on narrow screens — they
   end up overlapping the centred content awkwardly otherwise. */
@media (max-width: 720px) {
  .float-sticker {
    width: 64px;
    height: 64px;
    font-size: 30px;
    border-radius: 18px;
  }
  .float-sticker.fs-coffee,
  .float-sticker.fs-clown {
    display: none;
  }
  .drop-zone-h {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 14px;
  }
  .drop-icon-tile {
    margin: 0 auto;
  }
  .drop-text {
    text-align: center;
  }
  .drop-zone-h .fs-sleep {
    display: none;
  }
}

/* ─── Mobile polish ────────────────────────────────────────────────── */
/* Shared nav-tightening rules (used by all three pages) plus the few
   home-only adjustments — most notably centring the body letter so it
   sits under the centred logo on phones instead of running flush left. */

@media (max-width: 720px) {
  /* Nav on mobile: drop the wordmark and let the three pills span the
     full width of the bar. Each link flexes to an equal third so they
     read as a tab strip rather than a left-aligned cluster. */
  .site-nav {
    padding: 8px;
    gap: 6px;
  }
  .site-nav-brand {
    display: none;
  }
  .site-nav-links {
    flex: 1;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: stretch;
  }
  .site-nav-link {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    font-size: 13px;
  }

  /* Word buttons render too chunky at desktop sizes; trim a little
     so they sit cleanly inside the inline copy. */
  .word-btn {
    box-shadow: 2px 2px 0 var(--shadow);
  }
  .word-btn:hover {
    box-shadow: 3px 3px 0 var(--shadow);
  }
  .word-btn:active,
  .word-btn.playing {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--shadow);
  }

  /* Centre the personal-letter copy on mobile so it lines up under the
     centred logo instead of left-aligning. */
  .home-copy {
    text-align: center;
  }

  /* Store badges wrap onto two centred lines if needed. */
  .home-hero.centered .store-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
}
