/* Guest phone app. */
body {
  overscroll-behavior-y: contain;
}

/* ---- join ---------------------------------------------------------------- */
#join {
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 18px calc(env(safe-area-inset-bottom) + 28px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.join-hero {
  text-align: center;
}
.join-hero h1 {
  font-size: clamp(2.1rem, 11vw, 3.1rem);
  font-weight: 900;
  margin-top: 6px;
}
.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.robot.bob {
  animation: bob 1.1s ease-in-out infinite alternate;
  filter: drop-shadow(0 12px 30px rgba(255, 46, 151, 0.45));
}
@keyframes bob {
  from {
    transform: translateY(0) rotate(-4deg);
  }
  to {
    transform: translateY(-9px) rotate(4deg);
  }
}
.join-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.join-card label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 6px;
}
.field.code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-family: var(--display);
  font-weight: 700;
  text-align: center;
}
.emoji-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-columns: 52px;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.emoji-grid::-webkit-scrollbar {
  display: none;
}
.emoji-grid button {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 1.7rem;
  background: var(--surface-2);
  border: 2px solid transparent;
  transition: transform 0.15s cubic-bezier(0.2, 1.6, 0.4, 1);
  scroll-snap-align: start;
}
.emoji-grid button[aria-checked='true'] {
  border-color: var(--pink);
  background: #3a1a4f;
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 0 22px -4px var(--pink);
}
.btn.big {
  margin-top: 10px;
  padding: 1.05em;
  font-size: 1.12rem;
  font-family: var(--display);
  font-weight: 700;
}
.error {
  min-height: 1.3em;
  margin: 0;
  color: var(--red);
  font-weight: 600;
  text-align: center;
}

/* ---- main layout --------------------------------------------------------- */
#main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 12px calc(env(safe-area-inset-bottom) + 88px);
  display: grid;
  gap: 12px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.05rem;
  min-width: 0;
}
.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pills {
  display: flex;
  gap: 6px;
  flex: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.42em 0.8em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.pill.hype {
  --h: 0;
  border-color: color-mix(in srgb, var(--yellow) calc(var(--h) * 1%), var(--line));
  box-shadow: 0 0 calc(var(--h) * 0.24px) -2px var(--yellow);
}
.pill.credits.zero {
  border-color: rgba(255, 82, 99, 0.6);
  color: var(--red);
}
.pill.pop {
  animation: pop 0.45s cubic-bezier(0.2, 1.8, 0.4, 1);
}
@keyframes pop {
  40% {
    transform: scale(1.3);
  }
}
.offline {
  text-align: center;
  font-size: 0.85rem;
  padding: 6px;
  border-radius: 10px;
  background: #3a1522;
  color: #ffb3bd;
}

/* ---- now playing --------------------------------------------------------- */
.np {
  position: relative;
  overflow: hidden;
  padding: 12px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
}
.np::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: var(--cover, none) center / cover;
  filter: blur(46px) saturate(1.6) brightness(0.5);
  opacity: 0.75;
  z-index: 0;
}
.np > * {
  position: relative;
  z-index: 1;
}
.np img.cover {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 26px -6px #000;
  background: var(--surface-2);
}
.np.playing img.cover {
  animation: pulse 0.5s ease-in-out infinite alternate;
}
@keyframes pulse {
  to {
    transform: scale(1.035);
  }
}
.np .label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.np h2 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 2px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np .artist,
.np .by {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np .by {
  color: var(--muted);
}
.np .bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.np .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 9px;
}
.np .actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
.np .actions button {
  flex: 1;
  padding: 0.7em;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 700;
  transition: transform 0.12s;
}
.np .actions button:active:not(:disabled) {
  transform: scale(0.95);
}
.np .actions .fire.on {
  background: linear-gradient(100deg, #ff7a18, #ff2e97);
  border-color: transparent;
  box-shadow: 0 0 26px -6px #ff7a18;
}
.np .actions .boo {
  flex: 0 0 34%;
  color: var(--muted);
}
.np .actions .boo.on {
  color: var(--text);
  background: #3a1522;
  border-color: #7c2a3e;
}
.np.empty {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 22px 16px;
}
.np.empty h2 {
  font-size: 1.1rem;
}

/* ---- reactions ----------------------------------------------------------- */
.reactbar {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.reactbar button {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 1.45rem;
  transition: transform 0.1s;
}
.reactbar button:active {
  transform: scale(0.82) rotate(-8deg);
}
#floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}
.floater {
  position: absolute;
  font-size: 2rem;
  animation: floatup 1.3s ease-out forwards;
}
@keyframes floatup {
  to {
    transform: translate(var(--dx), -62vh) rotate(var(--rot)) scale(1.7);
    opacity: 0;
  }
}

/* ---- DJ speech bubble ---------------------------------------------------- */
.djline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: toast-in 0.3s ease both;
}
.djline p {
  margin: 0;
  padding: 0.6em 0.9em;
  border-radius: 4px 16px 16px 16px;
  background: linear-gradient(100deg, rgba(255, 46, 151, 0.2), rgba(34, 227, 255, 0.14));
  border: 1px solid rgba(255, 46, 151, 0.35);
  font-size: 0.95rem;
  font-style: italic;
}

/* ---- lists --------------------------------------------------------------- */
.tab {
  display: grid;
  gap: 10px;
  min-height: 30dvh;
  align-content: start;
}
.tab h3 {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--body);
  font-weight: 800;
  margin: 6px 4px 0;
}
.list {
  display: grid;
  gap: 8px;
}
.row {
  display: grid;
  grid-template-columns: auto 50px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 66px;
}
.row .rank {
  width: 22px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
}
.row img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}
.row .meta {
  min-width: 0;
}
.row .title {
  font-weight: 650;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row .sub {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 6px;
  background: rgba(34, 227, 255, 0.16);
  color: var(--cyan);
  vertical-align: 1px;
}
.row .tag.e {
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}
.row.mine {
  border-color: rgba(255, 46, 151, 0.55);
  background: linear-gradient(100deg, rgba(255, 46, 151, 0.12), var(--surface) 55%);
}
.row.locked {
  border-color: rgba(255, 225, 74, 0.6);
  background: linear-gradient(100deg, rgba(255, 225, 74, 0.14), var(--surface) 60%);
}
.row.locked .rank {
  color: var(--yellow);
}
.votes {
  display: grid;
  grid-template-columns: 38px 30px 38px;
  align-items: center;
  text-align: center;
}
.votes button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.12s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.votes button:active:not(:disabled) {
  transform: scale(0.8);
}
.votes .up.on {
  background: var(--lime);
  border-color: var(--lime);
  color: #06210a;
  box-shadow: 0 0 18px -4px var(--lime);
}
.votes .down.on {
  background: var(--red);
  border-color: var(--red);
  color: #2a0509;
}
.votes b {
  font-family: var(--display);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.votes b.pos {
  color: var(--lime);
}
.votes b.neg {
  color: var(--red);
}
.row .side {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row .x {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.row .add {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--grad);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}
.row .add.done {
  background: var(--surface-2);
  font-size: 1rem;
}
.row .why {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  max-width: 84px;
  text-align: right;
}
.empty-note {
  text-align: center;
  padding: 26px 14px;
  color: var(--muted);
}
.empty-note b {
  display: block;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.empty-note .btn {
  margin-top: 14px;
}

/* ---- search / credits ---------------------------------------------------- */
.search-box {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 6px);
  z-index: 5;
}
.search-box .field {
  box-shadow: 0 10px 30px -12px #000;
  background: #1a1433;
}
.credit-info {
  padding: 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
}
.credit-info b {
  color: var(--text);
}
.credit-info.zero {
  padding: 12px 14px;
  border-radius: 14px;
  background: #2a1830;
  border: 1px solid #5a2a55;
  color: var(--text);
}
.credit-info ul {
  margin: 6px 0 0;
  padding-left: 1.1em;
  color: var(--muted);
}
.spinner {
  width: 26px;
  height: 26px;
  margin: 24px auto;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--pink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- shout --------------------------------------------------------------- */
.shout-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}
.shout-card textarea {
  min-height: 92px;
  resize: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips button {
  padding: 0.45em 0.8em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}
.counter {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  margin-top: -6px;
}

/* ---- top ----------------------------------------------------------------- */
.leader {
  display: grid;
  grid-template-columns: 34px 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.leader .place {
  font-size: 1.35rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  color: var(--muted);
}
.leader .face {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--surface-2);
}
.leader .who b {
  display: block;
}
.leader .who small {
  color: var(--yellow);
  font-weight: 700;
}
.leader .pts {
  font-family: var(--display);
  font-weight: 700;
}
.leader.first {
  border-color: rgba(255, 225, 74, 0.6);
  background: linear-gradient(100deg, rgba(255, 225, 74, 0.16), var(--surface) 60%);
}
.leader.me {
  outline: 2px solid var(--pink);
}
.how {
  padding: 14px 16px;
  font-size: 0.92rem;
}
.how ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.how b {
  color: var(--text);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats div {
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.stats b {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
}
.stats span {
  font-size: 0.76rem;
  color: var(--muted);
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.profile .face {
  font-size: 2rem;
}
.profile .grow {
  flex: 1;
  min-width: 0;
}

/* ---- bottom navigation --------------------------------------------------- */
.tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(536px, calc(100% - 20px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px;
  border-radius: 22px;
  background: rgba(27, 20, 54, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px -10px #000;
  z-index: 20;
}
.tabs button {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 0 6px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.tabs button i {
  font-style: normal;
  font-size: 1.25rem;
  filter: grayscale(0.8) opacity(0.7);
  transition: transform 0.2s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.tabs button.on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.tabs button.on i {
  filter: none;
  transform: scale(1.18) translateY(-1px);
}
.tabs button .badge {
  position: absolute;
}

/* celebration when your own song comes on */
.confetti {
  position: fixed;
  top: -12px;
  width: 9px;
  height: 14px;
  z-index: 45;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translate(var(--dx), 105vh) rotate(var(--rot));
  }
}

/* the wardrobe */
.style-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
}
.style-preview svg {
  display: block;
  width: 118px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(255, 46, 151, 0.35));
}
.style-by {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
}
.style-wait {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 225, 74, 0.12);
  border: 1px solid rgba(255, 225, 74, 0.35);
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}
.wear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.wear {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border-radius: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.wear svg {
  width: 54px;
  height: auto;
  pointer-events: none;
}
.wear:active {
  transform: scale(0.94);
}
.wear.on {
  border-color: var(--pink);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 46, 151, 0.18);
}
.wear .swatch {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  margin: 4px 0;
}
.cooling .wear:not(.on) {
  opacity: 0.45;
}
