/* ================================================
   SECRET SESSIONS — Design System
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Remove 300ms tap delay on iOS everywhere */
button, a, input { touch-action: manipulation; }

:root {
  --bg:        #0e0e16;
  --bg-card:   rgba(255,255,255,0.06);
  --bg-hover:  rgba(255,255,255,0.1);
  --border:    rgba(255,255,255,0.09);
  --c1:        #ff6b6b;   /* coral */
  --c2:        #a855f7;   /* purple */
  --c3:        #22d3ee;   /* cyan */
  --text:      #f4f4f8;
  --muted:     #7c7c9a;
  --r:         14px;
  --r-sm:      10px;
}

html, body { height: 100%; height: 100dvh; overflow: hidden; font-family: 'Inter', sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* ── Screens ──────────────────────────────────── */
/* Use visibility/pointer-events (not display:none) so opacity transitions
   actually fire on Safari iOS and the element stays interactive. */
.screen {
  position: fixed; inset: 0;
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  /* When hiding: fade out, then instantly set visibility:hidden */
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.screen.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  /* When showing: instantly set visibility:visible, then fade in */
  transition: opacity .3s ease, visibility 0s linear 0s;
}

/* ── Background orbs ──────────────────────────── */
.landing-bg { position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .3;
  animation: drift 10s ease-in-out infinite alternate; }
.orb1 { width:520px;height:520px;background:radial-gradient(circle,var(--c2),transparent 70%);
  top:-160px;left:-160px;animation-delay:0s; }
.orb2 { width:420px;height:420px;background:radial-gradient(circle,var(--c1),transparent 70%);
  bottom:-120px;right:-120px;animation-delay:-4s; }
.orb3 { width:300px;height:300px;background:radial-gradient(circle,var(--c3),transparent 70%);
  top:50%;left:50%;transform:translate(-50%,-50%);animation-delay:-7s; }
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(25px,20px) scale(1.08); }
}

/* ── LANDING ──────────────────────────────────── */
#screen-landing { flex-direction:column; align-items:center; justify-content:center; }

.landing-content {
  position:relative; z-index:1; display:flex; flex-direction:column;
  align-items:center; gap:28px; width:100%; max-width:680px; padding:40px 24px;
}

/* ── Brand hero ────────────────────────────────── */
.brand-hero { text-align:center; display:flex; flex-direction:column; align-items:center; gap:0; }

.brand-lock {
  font-size:2.2rem;
  display:block;
  margin-bottom:10px;
  filter:drop-shadow(0 0 24px rgba(168,85,247,.7));
  animation: lockpulse 3s ease-in-out infinite;
}
@keyframes lockpulse {
  0%,100% { filter:drop-shadow(0 0 20px rgba(168,85,247,.5)); transform:scale(1); }
  50%      { filter:drop-shadow(0 0 36px rgba(255,107,107,.7)); transform:scale(1.08); }
}

.brand-title {
  font-size:clamp(3rem, 12.8vw, 6.8rem);
  font-weight:900;
  line-height:0.88;
  letter-spacing:-0.03em;
  text-transform:uppercase;
  text-align:center;
  background:linear-gradient(135deg, var(--c1) 0%, var(--c2) 55%, var(--c3) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  margin-bottom:18px;
}
.brand-tagline {
  font-size:1.15rem;
  font-weight:700;
  color:rgba(255,255,255,.9);
  margin-bottom:6px;
  letter-spacing:0.01em;
}

.brand-sub {
  font-size:.88rem;
  color:var(--muted);
  max-width:420px;
  margin:0 auto;
  line-height:1.6;
}

/* keep old selectors working for anything that might reference them */
.sub { text-align:center; color:var(--muted); font-size:.95rem; line-height:1.6; max-width:480px; }

/* name input */
.name-wrap { width:100%; display:flex; flex-direction:column; gap:8px; }
.field-label { font-size:.75rem; font-weight:700; letter-spacing:.8px;
  text-transform:uppercase; color:var(--muted); }

/* ── Inputs ───────────────────────────────────── */
.text-input {
  width:100%; background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:var(--r-sm); padding:13px 16px; color:var(--text);
  font-size:1rem; font-family:inherit; outline:none;
  transition:border-color .2s, background .2s;
}
.text-input::placeholder { color:var(--muted); }
.text-input:focus { border-color:var(--c2); background:rgba(168,85,247,.08); }

.code-input { text-transform:uppercase; letter-spacing:4px; font-weight:700;
  font-size:1.1rem; text-align:center; }

/* ── Option cards ─────────────────────────────── */
.cards-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; width:100%; }

.option-card {
  background:var(--bg-card); border:1.5px solid var(--border);
  border-radius:var(--r); padding:24px 20px; display:flex;
  flex-direction:column; gap:12px;
  transition:border-color .2s, background .2s;
}
.option-card:hover { border-color:rgba(255,255,255,.18); background:var(--bg-hover); }

.card-icon { font-size:1.8rem; }
.card-title { font-size:1rem; font-weight:800; }
.card-desc { font-size:.82rem; color:var(--muted); line-height:1.5; flex:1; }

/* ── Buttons ──────────────────────────────────── */
.btn { border:none; border-radius:var(--r-sm); padding:12px 20px; font-size:.9rem;
  font-family:inherit; font-weight:700; cursor:pointer; width:100%;
  transition:transform .15s, box-shadow .2s, opacity .15s; }
.btn:hover  { transform:translateY(-2px); }
.btn:active { transform:translateY(0); opacity:.85; }

.btn-primary {
  background:linear-gradient(135deg,var(--c1),var(--c2)); color:#fff;
  box-shadow:0 4px 20px rgba(168,85,247,.35);
}
.btn-primary:hover { box-shadow:0 6px 28px rgba(168,85,247,.5); }

.btn-secondary { background:rgba(255,255,255,.08); color:var(--text);
  border:1.5px solid var(--border); }
.btn-secondary:hover { background:rgba(255,255,255,.14); }

.error-msg { font-size:.82rem; color:#ff6b6b; background:rgba(255,107,107,.1);
  border:1px solid rgba(255,107,107,.3); border-radius:var(--r-sm);
  padding:8px 12px; text-align:center; }
.hidden { display:none !important; }

/* ── ROOM SCREEN ──────────────────────────────── */
#screen-room { flex-direction:column; background:var(--bg); }

/* Album blurred background */
.album-bg {
  position:fixed; inset:-30px; z-index:0;
  background-image:var(--album-bg,none);
  background-size:cover; background-position:center;
  filter:blur(50px) saturate(2.5) brightness(.35);
  transform:scale(1.15);
  transition:background-image 2s ease, opacity 1s ease;
  opacity:0;
}
.album-bg.visible { opacity:1; }
.album-bg-overlay {
  position:fixed; inset:0; z-index:1;
  background:linear-gradient(180deg, rgba(14,14,22,.7) 0%, rgba(14,14,22,.5) 50%, rgba(14,14,22,.9) 100%);
}

/* Reaction canvas */
#reaction-canvas { position:fixed; inset:0; pointer-events:none; z-index:50; overflow:hidden; }

/* ── Room header ──────────────────────────────── */
.room-header {
  position:relative; z-index:10; display:flex; align-items:center; gap:12px;
  padding:12px 20px; background:rgba(14,14,22,.8); backdrop-filter:blur(20px);
  border-bottom:1px solid var(--border); flex-shrink:0;
}

.logo-sm { font-size:.85rem; font-weight:800; letter-spacing:.5px;
  color:var(--muted); white-space:nowrap; }

/* Room code pill — the MAIN share element */
.code-pill {
  display:flex; align-items:center; gap:8px;
  background:linear-gradient(135deg,rgba(255,107,107,.15),rgba(168,85,247,.15));
  border:1.5px solid rgba(168,85,247,.4); border-radius:50px;
  padding:7px 16px; cursor:pointer; font-family:inherit;
  transition:background .2s, border-color .2s;
}
.code-pill:hover { background:linear-gradient(135deg,rgba(255,107,107,.25),rgba(168,85,247,.25));
  border-color:rgba(168,85,247,.7); }

.code-label { font-size:.6rem; font-weight:800; letter-spacing:1.5px;
  color:var(--muted); text-transform:uppercase; }

#room-code-text { font-size:1.1rem; font-weight:900; letter-spacing:4px;
  background:linear-gradient(135deg,var(--c1),var(--c2));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

.code-copy-icon { font-size:.9rem; color:var(--muted); }

.copy-toast { font-size:.75rem; font-weight:700; color:#4ade80;
  animation:fadeUpOut 1.5s ease forwards; }
@keyframes fadeUpOut {
  0%   { opacity:1; transform:translateY(0); }
  80%  { opacity:1; transform:translateY(-4px); }
  100% { opacity:0; transform:translateY(-10px); }
}

/* user avatars */
.user-list { flex:1; display:flex; align-items:center; gap:6px;
  overflow:hidden; flex-wrap:nowrap; }
.user-avatar {
  width:32px; height:32px; border-radius:50%; display:inline-flex;
  align-items:center; justify-content:center; font-size:.7rem; font-weight:800;
  border:2px solid rgba(255,255,255,.15); position:relative; cursor:default;
  transition:transform .2s;
}
.user-avatar:hover { transform:scale(1.12); }
.user-avatar .tip {
  position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,.9); color:#fff; font-size:.65rem; padding:3px 7px;
  border-radius:6px; white-space:nowrap; opacity:0; pointer-events:none;
  transition:opacity .15s;
}
.user-avatar:hover .tip { opacity:1; }

.btn-leave { background:rgba(255,107,107,.12); border:1px solid rgba(255,107,107,.3);
  border-radius:8px; padding:6px 13px; color:#ff6b6b; font-size:.8rem;
  font-weight:700; cursor:pointer; font-family:inherit; transition:background .2s;
  white-space:nowrap; flex-shrink:0; }
.btn-leave:hover { background:rgba(255,107,107,.22); }

/* ── Room main ────────────────────────────────── */
.room-main {
  flex:1; display:grid; grid-template-columns:320px 1fr;
  gap:0; overflow:hidden; position:relative; z-index:5;
  min-height:0;
}

/* Player col */
.player-col {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:20px; padding:28px 24px; border-right:1px solid var(--border);
  overflow:hidden;
}

/* Album art */
.album-art-wrap {
  width:180px; height:180px; border-radius:20px; flex-shrink:0;
  position:relative; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,rgba(168,85,247,.25),rgba(255,107,107,.25));
  border:1px solid rgba(255,255,255,.1); overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}
.album-art-wrap img { width:100%; height:100%; object-fit:cover; border-radius:20px; }
.album-pulse {
  position:absolute; inset:-8px; border-radius:28px;
  background:linear-gradient(135deg,var(--c2),var(--c1));
  opacity:.2; animation:pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform:scale(1); opacity:.2; }
  50%      { transform:scale(1.06); opacity:.35; }
}
.album-placeholder { font-size:3.5rem; position:relative; z-index:1;
  animation:noteDrift 3s ease-in-out infinite; }
@keyframes noteDrift {
  0%,100% { transform:scale(1) rotate(-5deg); }
  50%      { transform:scale(1.1) rotate(5deg); }
}

/* Track info */
.track-info { width:100%; display:flex; flex-direction:column; gap:6px; align-items:center;
  text-align:center; }
.track-name { font-size:1rem; font-weight:800; line-height:1.3; }
.track-artist { font-size:.85rem; color:var(--muted); }

/* Progress */
.progress-wrap { width:100%; display:flex; flex-direction:column; gap:4px; margin-top:4px; }
.progress-bg {
  width:100%; height:5px; background:rgba(255,255,255,.1);
  border-radius:3px; overflow:hidden;
  cursor:pointer;   /* seekable */
  transition:height .15s;
}
.progress-bg:hover { height:7px; }
.progress-fill { height:100%; width:0%;
  background:linear-gradient(90deg,var(--c1),var(--c2));
  border-radius:3px; transition:width .8s linear; }
.progress-times { display:flex; justify-content:space-between; font-size:.68rem;
  color:var(--muted); font-variant-numeric:tabular-nums; }

/* ── Playback controls ────────────────────────── */
.player-controls {
  display:flex; align-items:center; justify-content:center; gap:12px; margin-top:10px;
  touch-action:manipulation;
}
.ctrl-btn {
  width:40px; height:40px; border-radius:50%;
  background:rgba(255,255,255,.08); border:1.5px solid var(--border);
  color:var(--text); font-size:1rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s, transform .12s, box-shadow .15s;
  touch-action:manipulation;
}
.ctrl-btn:hover  { background:rgba(255,255,255,.15); }
.ctrl-btn:active { transform:scale(.87); }
.ctrl-btn.ctrl-main {
  width:52px; height:52px; font-size:1.4rem;
  background:linear-gradient(135deg,var(--c1),var(--c2));
  border-color:transparent;
  box-shadow:0 4px 18px rgba(168,85,247,.35);
}
.ctrl-btn.ctrl-main:hover { filter:brightness(1.12); box-shadow:0 6px 24px rgba(168,85,247,.5); }
.ctrl-btn:disabled { opacity:.35; cursor:default; transform:none !important; }

/* Spotify button */
.btn-spotify {
  display:inline-flex; align-items:center; gap:7px;
  background:rgba(30,215,96,.1); border:1.5px solid rgba(30,215,96,.35);
  border-radius:50px; padding:8px 18px; color:#1ed760; font-size:.8rem;
  font-weight:700; cursor:pointer; font-family:inherit; margin-top:4px;
  transition:background .2s, border-color .2s;
}
.btn-spotify:hover { background:rgba(30,215,96,.18); border-color:rgba(30,215,96,.6); }

/* ── Lyrics col ───────────────────────────────── */
.lyrics-col {
  display:flex; flex-direction:column; overflow:hidden;
  padding:0;
}
.lyrics-header {
  padding:16px 24px 12px; font-size:.65rem; font-weight:800;
  letter-spacing:2px; text-transform:uppercase; color:var(--muted);
  border-bottom:1px solid var(--border); flex-shrink:0;
}
.lyrics-scroll {
  flex:1; overflow-y:auto; padding:24px; scroll-behavior:smooth;
  scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.1) transparent;
}
.lyrics-scroll::-webkit-scrollbar { width:4px; }
.lyrics-scroll::-webkit-scrollbar-track { background:transparent; }
.lyrics-scroll::-webkit-scrollbar-thumb { background:rgba(255,255,255,.1); border-radius:2px; }

.lyrics-empty { color:var(--muted); font-size:.9rem; line-height:1.6;
  text-align:center; padding:40px 0; }

.lyric-line {
  font-size:1.3rem; font-weight:700; line-height:1.5; color:rgba(255,255,255,.25);
  margin:6px 0; cursor:default; transition:color .3s, transform .3s, font-size .3s;
  transform-origin:left center;
}
.lyric-line.active {
  color:#fff; font-size:1.5rem;
  text-shadow: 0 0 30px rgba(168,85,247,.6);
}
.lyric-line.near { color:rgba(255,255,255,.55); }

/* ── Reaction bar ─────────────────────────────── */
.reaction-bar {
  position:relative; z-index:10; flex-shrink:0;
  padding:12px 20px 18px;
  background:rgba(14,14,22,.85); backdrop-filter:blur(20px);
  border-top:1px solid var(--border);
}
.reaction-label { text-align:center; font-size:.6rem; font-weight:800;
  letter-spacing:2px; color:var(--muted); text-transform:uppercase; margin-bottom:10px; }
.emoji-grid { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; touch-action: manipulation; }
.emoji-btn {
  width:50px; height:50px; border-radius:50%; background:var(--bg-card);
  border:1.5px solid var(--border); font-size:1.5rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s, background .15s, box-shadow .15s;
}
.emoji-btn:hover { background:var(--bg-hover); transform:scale(1.22);
  box-shadow:0 4px 18px rgba(168,85,247,.3); }
.emoji-btn:active { transform:scale(.9); }

/* ── Floating reactions ───────────────────────── */
.floating-reaction {
  position:absolute; bottom:22%; pointer-events:none;
  display:flex; flex-direction:column; align-items:center; gap:3px; z-index:100;
}
.floating-reaction .r-emoji { font-size:2rem; }
.floating-reaction .r-name {
  font-size:.6rem; font-weight:700; color:rgba(255,255,255,.65);
  background:rgba(0,0,0,.45); border-radius:8px; padding:2px 6px;
  white-space:nowrap;
}
/* Text reactions float as a speech-bubble style pill */
.floating-text-reaction .r-text {
  background: linear-gradient(135deg, rgba(168,85,247,.85), rgba(255,107,107,.75));
  color: #fff;
  border-radius: 18px;
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 700;
  max-width: 200px;
  word-break: break-word;
  text-align: center;
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.2);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  line-height: 1.3;
}

/* ── System toast ─────────────────────────────── */
.sys-toast {
  position:fixed; top:70px; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,.8); color:rgba(255,255,255,.85);
  font-size:.78rem; font-weight:600; padding:6px 16px;
  border-radius:50px; backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.1);
  z-index:200; white-space:nowrap; pointer-events:none;
}

/* ── Avatar colours ───────────────────────────── */
.av0{background:linear-gradient(135deg,#a855f7,#7c3aed)}
.av1{background:linear-gradient(135deg,#ff6b6b,#c0392b)}
.av2{background:linear-gradient(135deg,#22d3ee,#0891b2)}
.av3{background:linear-gradient(135deg,#fb923c,#c2410c)}
.av4{background:linear-gradient(135deg,#4ade80,#16a34a)}
.av5{background:linear-gradient(135deg,#f472b6,#be185d)}
.av6{background:linear-gradient(135deg,#facc15,#b45309)}
.av7{background:linear-gradient(135deg,#38bdf8,#0369a1)}

/* ================================================
   MOBILE  ≤ 640px
   ================================================ */
@media (max-width: 640px) {

  /* ── Landing ── */
  #screen-landing { justify-content: flex-start; overflow-y: auto; padding-top: env(safe-area-inset-top); }
  .landing-content { padding: 32px 18px 40px; gap: 20px; }
  h1 { font-size: 2rem; letter-spacing: -.5px; }
  .sub { font-size: .875rem; }
  .cards-row { grid-template-columns: 1fr; gap: 12px; }
  .option-card { padding: 20px 16px; gap: 10px; }
  .card-desc { font-size: .8rem; }
  .btn { padding: 14px 20px; font-size: .95rem; min-height: 48px; }

  /* ── Room screen: full-height flex column ── */
  #screen-room { flex-direction: column; }

  /* ── Header: slim ── */
  .room-header { padding: 10px 14px; gap: 8px; flex-shrink: 0; }
  .logo-sm { display: none; }               /* hide "SS" wordmark */
  .code-pill { padding: 6px 12px; gap: 6px; }
  .code-label { display: none; }            /* hide "ROOM" label */
  #room-code-text { font-size: 1rem; letter-spacing: 3px; }
  .code-copy-icon { font-size: .8rem; }
  .user-list { gap: 4px; }
  .user-avatar { width: 28px; height: 28px; font-size: .62rem; }
  .btn-leave { padding: 6px 10px; font-size: .75rem; }

  /* ── Main: single column, flex ── */
  .room-main {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0; overflow: hidden;
  }

  /* ── Player strip: compact horizontal row ── */
  .player-col {
    flex-direction: row; align-items: center;
    justify-content: flex-start;
    padding: 12px 16px; gap: 14px;
    border-right: none; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .album-art-wrap {
    width: 58px; height: 58px; border-radius: 10px; flex-shrink: 0;
  }
  .album-pulse { display: none; }           /* skip pulse on tiny art */
  .album-placeholder { font-size: 1.6rem; }
  .track-info {
    align-items: flex-start; text-align: left; gap: 3px; min-width: 0;
  }
  .track-name  { font-size: .9rem; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .track-artist { font-size: .75rem; }
  .progress-wrap { margin-top: 2px; }
  .progress-bg { height: 2px; }
  .progress-timers { font-size: .6rem; }
  .player-controls { gap: 8px; margin-top: 6px; justify-content: flex-start; }
  .ctrl-btn { width: 30px; height: 30px; font-size: .8rem; }
  .ctrl-btn.ctrl-main { width: 38px; height: 38px; font-size: 1rem; }
  .btn-spotify {
    font-size: .7rem; padding: 5px 12px; margin-top: 2px;
  }
  .btn-spotify svg { width: 13px; height: 13px; }

  /* ── Lyrics: grow to fill remaining space ── */
  .lyrics-col {
    flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
  }
  .lyrics-header { padding: 10px 16px 8px; font-size: .58rem; }
  .lyrics-scroll { padding: 16px 20px; flex: 1; min-height: 0; }
  .lyric-line       { font-size: 1.15rem; margin: 5px 0; }
  .lyric-line.near  { font-size: 1.15rem; }
  .lyric-line.active { font-size: 1.35rem; }

  /* ── Reaction bar: horizontal scroll, no wrap ── */
  .reaction-bar {
    padding: 10px 0 calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
  .reaction-label { margin-bottom: 8px; }
  .emoji-grid {
    flex-wrap: nowrap;               /* single row */
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    padding: 4px 16px 4px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;           /* hide scrollbar */
  }
  .emoji-grid::-webkit-scrollbar { display: none; }
  .emoji-btn {
    width: 54px; height: 54px; flex-shrink: 0;
    font-size: 1.5rem;
  }
  /* Recent row: horizontal scroll on mobile too */
  .recent-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 6px 16px 2px;
    scrollbar-width: none;
  }
  .recent-row::-webkit-scrollbar { display: none; }
  .recent-row .emoji-btn { flex-shrink: 0; }
  /* Text input: compact on mobile */
  .text-reaction-wrap {
    margin: 8px 16px 0;
    max-width: none;
  }
  .text-reaction-input { font-size: .78rem; padding: 7px 14px; }
  .text-reaction-send  { font-size: .75rem; padding: 7px 13px; }

  /* ── Floating reactions: start higher so they clear emoji bar ── */
  .floating-reaction { bottom: 28%; }

  /* ── Toasts: account for header ── */
  .sys-toast { top: 62px; font-size: .72rem; }
}

/* ── Very small phones (SE, etc) ── */
@media (max-width: 375px) {
  h1 { font-size: 1.75rem; }
  .album-art-wrap { width: 50px; height: 50px; }
  .track-name { font-size: .82rem; }
  .emoji-btn { width: 48px; height: 48px; font-size: 1.35rem; }
  .lyric-line { font-size: 1rem; }
  .lyric-line.active { font-size: 1.2rem; }
}

/* ── Custom / recently-picked emoji row ───────────
   Lives BELOW the standard emoji grid so standard
   buttons never shift when this row appears/changes.
   ─────────────────────────────────────────────── */
.recent-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 4px;
}
,recent-row.hidden { display: none !important; }

/* ── Text reaction input ─────────────────────── */
.text-reaction-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
 .text-reaction-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 9px 18px;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
  min-width: 0;
}
.text-reaction-input::placeholder { color: var(--muted); }
.text-reaction-input:focus {
  border-color: var(--c2);
  background: rgba(168,85,247,.08);
}
.text-reaction-send {
  background: rgba(168,85,247,.15);
  border: 1.5px solid rgba(168,85,247,.4);
  border-radius: 50px;
  padding: 9px 18px;
  color: var(--c2);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .1s;
}
.text-reaction-send:hover  { background: rgba(168,85,247,.3); border-color: rgba(168,85,247,.7); }
.text-reaction-send:active { transform: scale(.92); }

/* ── More (＋) button ──────────────────────────── */
.emoji-more-btn {
  font-size: 1.3rem !important;
  background: rgba(168,85,247,.12) !important;
  border-color: rgba(168,85,247,.35) !important;
  color: var(--c2);
  font-weight: 700;
  letter-spacing: -1px;
}
.emoji-more-btn:hover {
  background: rgba(168,85,247,.25) !important;
  border-color: rgba(168,85,247,.6) !important;
}

/* ── Emoji Picker Overlay ──────────────────────── */
.emoji-picker-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.emoji-picker-overlay.hidden { display: none; }

.picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
  animation: backdropIn .22s ease;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.picker-sheet {
  position: relative; z-index: 1;
  background: #161620;
  border-top: 1px solid rgba(255,255,255,.1);
  border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; flex-direction: column;
  max-height: 60vh;
  animation: sheetUp .26s cubic-bezier(.25,.46,.45,.94);
}
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: .6; }
  to   { transform: translateY(0);    opacity: 1;  }
}

.picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 10px; flex-shrink: 0;
}
 .picker-title {
  font-size: .75rem; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.picker-close {
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; font-weight: 700;
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
 .picker-close:hover { background: rgba(255,107,107,.2); color: #ff6b6b; }

/* Category tabs */
.picker-cats {
  display: flex; gap: 6px; padding: 0 16px 12px;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.picker-cats::-webkit-scrollbar { display: none; }

.cat-btn {
  background: rgba(255,255,255,.06); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 5px 14px;
  font-size: .75rem; font-weight: 700; color: var(--muted);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.cat-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.cat-btn.active {
  background: linear-gradient(135deg, rgba(255,107,107,.2), rgba(168,85,247,.2));
  border-color: rgba(168,85,247,.5); color: var(--text);
}

/* Emoji grid inside picker */
.picker-emojis {
  flex: 1; overflow-y: auto; padding: 8px 16px 16px;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-content: flex-start;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.picker-emojis::-webkit-scrollbar { width: 4px; }
 .picker-emojis::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.picker-empty {
  width: 100%; text-align: center; color: var(--muted);
  font-size: .85rem; padding: 28px 0;
}

.picker-emoji-btn {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1.5px solid transparent;
  font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .12s, border-color .12s;
  touch-action: manipulation;
}
.picker-emoji-btn:hover {
  background: rgba(168,85,247,.18); border-color: rgba(168,85,247,.4);
  transform: scale(1.2);
}
.picker-emoji-btn:active { transform: scale(.88); }

/* ── Landscape mobile: side-by-side, shorter rows ── ─ */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .room-main { flex-direction: row; }
  .player-col {
    flex-direction: column; align-items: center; width: 160px;
    flex-shrink: 0; border-right: 1px solid var(--border); border-bottom: none;
    padding: 10px;
  }
  .album-art-wrap { width: 70px; height: 70px; }
  .track-info { align-items: center; text-align: center; }
  .lyrics-col { flex: 1; }
  .lyric-line { font-size: .95rem; }
  .lyric-line.active { font-size: 1.1rem; }
  .emoji-grid { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    padding: 4px 12px; scrollbar-width: none; }
  .emoji-grid::-webkit-scrollbar { display: none; }
}
