/* ADEERA ENCORE! FAN CAFE (leaderboards) + the 404 page. Everything is scoped under .cafe / .omo404. */

.cafe,
.omo404 {
  --c-night: #160b2e;
  --c-stage: #2e1257;
  --c-hot: #ff4fa3;
  --c-lav: #b9a6ff;
  --c-mint: #5ef2d0;
  --c-butter: #ffe066;
  --c-sky: #7cc8ff;
  --c-text: #f6efff;
  --c-soft: rgba(246, 239, 255, 0.68);
  --c-faint: rgba(246, 239, 255, 0.4);
  --c-line: rgba(255, 255, 255, 0.12);
  --c-cute: var(--cute, "Jua", ui-rounded, system-ui, sans-serif);
  --c-loud: var(--loud, "Black Han Sans", "Jua", Impact, sans-serif);
}

/* ---------- Frame ---------- */
/* Fills #cafe-root (.mount, a flex column inside the #scr-cafe .screen, which pads for safe areas
   and paints the scrim). The header reuses style.css's .bar / .back / .onair / .seg / .wallet. */

.cafe {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--c-text);
  font-family: var(--c-cute);
  -webkit-tap-highlight-color: transparent;
}

.cafe button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.cafe button:focus-visible {
  outline: 3px solid var(--c-butter);
  outline-offset: 2px;
}

.cafe [hidden] { display: none !important; }

.cafe-bar { margin-bottom: 10px; }
.cafe-bar .seg .kr { color: var(--c-lav); }

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

.cafe-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cafe-side {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cafe-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Fan card ---------- */

.cafe-me {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head row" "name name";
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding: 9px 10px 10px 14px;
  border: 2px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(46, 18, 87, 0.95), rgba(22, 11, 46, 0.95)) padding-box,
    linear-gradient(120deg, var(--c-hot), var(--c-lav) 50%, var(--c-mint)) border-box;
  box-shadow: 0 8px 26px rgba(255, 79, 163, 0.18);
  overflow: hidden;
}

.cafe-me::after {
  /* a slow holo sheen across the membership card */
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 255, 255, 0.08) 50%, transparent 56%);
  animation: cafe-sheen 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cafe-sheen {
  0%, 60% { transform: translateX(-40%); }
  100% { transform: translateX(40%); }
}

.cafe-me-head {
  grid-area: head;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--c-soft);
  white-space: nowrap;
}

.cafe-me-club { overflow: hidden; text-overflow: ellipsis; }

.cafe-me-stick { width: 16px; height: 16px; transform: rotate(-12deg); }

.cafe-name {
  grid-area: name;
  min-width: 0;
  margin: -4px -8px;
  padding: 4px 8px;
  font: clamp(22px, 6.4vw, 27px)/1.15 var(--c-cute);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 12px rgba(185, 166, 255, 0.55);
  transform-origin: 0 60%;
}

.cafe-num { color: var(--c-mint); font-size: 0.82em; }
.cafe-name.is-rolling { filter: blur(0.6px); opacity: 0.85; }
.cafe-name.is-rolling .cafe-noun,
.cafe-name.is-rolling .cafe-num { color: var(--c-lav); }
.cafe-name.is-landed { animation: cafe-land 0.42s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes cafe-land {
  0% { transform: scale(1.18) rotate(-2deg); text-shadow: 0 0 22px var(--c-hot); }
  100% { transform: none; }
}

.cafe-me-row {
  grid-area: row;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cafe-reroll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 10px 7px 12px;
  font: 14px/1 var(--c-loud) !important;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  transition: transform 0.12s, background 0.12s;
}

.cafe-reroll:hover:not(:disabled) { background: rgba(255, 79, 163, 0.3); }
.cafe-reroll:active:not(:disabled) { transform: scale(0.94); }
.cafe-reroll:disabled { opacity: 0.45; cursor: not-allowed; }
.cafe-reroll.is-broke { animation: cafe-shake 0.35s; }
.cafe-dice { width: 16px; height: 16px; }
.cafe-reroll:hover:not(:disabled) .cafe-dice { animation: cafe-spin 0.5s ease-out; }

.cafe-reroll-cost {
  padding: 3px 7px 4px;
  font: 12px/1 var(--c-cute);
  color: var(--c-night);
  background: var(--c-mint);
  border-radius: 999px;
}

.cafe-reroll-cost.is-honey { background: var(--c-butter); }
.cafe-reroll-cost.is-honey::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 4px;
  background: #c77a12;
  border-radius: 0 50% 50% 50%;
  transform: rotate(45deg) translateY(-1px);
}

@keyframes cafe-shake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes cafe-spin { to { transform: rotate(360deg); } }

/* ---------- Tabs ---------- */

.cafe-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--c-line);
  border-radius: 999px;
}

.cafe-tab {
  position: relative;
  z-index: 1;
  min-height: 44px;
  padding: 9px 6px 10px;
  font: 15px/1 var(--c-loud) !important;
  letter-spacing: 0.04em;
  color: var(--c-soft) !important;
  background: none;
  border: 0;
  border-radius: 999px;
  transition: color 0.2s;
}

.cafe-tab[aria-selected="true"] { color: #fff !important; }

.cafe-tab-ink {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-hot), #b06cff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) inset, 0 4px 18px rgba(255, 79, 163, 0.45);
  transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.cafe-tabs.on-all .cafe-tab-ink { transform: translateX(100%); }

/* ---------- Pickers ---------- */

.cafe-pickers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cafe-daily {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.cafe-cover {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 6px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.cafe-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 6px, transparent 6px 12px);
}

.cafe-cover-kr {
  position: relative;
  z-index: 1;
  font: 19px/1 var(--c-cute);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 0 rgba(22, 11, 46, 0.6), 0 0 10px rgba(22, 11, 46, 0.6);
  padding: 0 4px;
  word-break: keep-all;
}

.cafe-daily-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.cafe-daily-when {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cafe-stamp {
  font-size: 12px;
  color: var(--c-hot);
  letter-spacing: 0.05em;
}

.cafe-daytoggle {
  display: inline-flex;
  padding: 2px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.cafe-day {
  position: relative;
  min-height: 30px;
  padding: 5px 11px 6px;
  font-size: 12px !important;
  color: var(--c-soft) !important;
  background: none;
  border: 0;
  border-radius: 999px;
}

.cafe-day::after { content: ""; position: absolute; inset: -7px -2px; } /* a 44 px thumb target around the small pill */

.cafe-day.is-on { color: var(--c-night) !important; background: var(--c-lav); }

.cafe-daily-album {
  font: 18px/1.05 var(--c-loud);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cafe-daily-track {
  font-size: 13px;
  color: var(--c-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cafe-daily-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 2px;
}

.cafe-mod {
  padding: 3px 7px 3px;
  font: 11px/1 var(--c-loud);
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 79, 163, 0.25);
  border: 1.5px solid var(--c-hot);
  border-radius: 6px;
  text-transform: uppercase;
}

.cafe-fans { font-size: 12px; color: var(--c-mint); }

.cafe-songs {
  position: relative;
  display: flex;
  gap: 8px;
  margin: 0 -16px;
  padding: 3px 16px 5px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.cafe-songs::-webkit-scrollbar { display: none; }

.cafe-song {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  scroll-snap-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.cafe-song:active { transform: scale(0.95); }
.cafe-song:hover { background: rgba(255, 255, 255, 0.12); }

.cafe-song.is-on {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  box-shadow: 0 0 18px rgba(185, 166, 255, 0.45);
}

.cafe-song-sw { width: 16px; height: 16px; border-radius: 5px; transform: rotate(45deg) scale(0.85); }
.cafe-song-name { font: 14px/1 var(--c-loud); letter-spacing: 0.03em; white-space: nowrap; }
.cafe-song-kr { display: none; margin-left: auto; font-size: 13px; color: var(--c-faint); white-space: nowrap; }
.cafe-song.is-on .cafe-song-kr { color: var(--c-lav); }
.cafe-song:not(.is-on) .cafe-song-name { color: var(--c-soft); }

.cafe-diffs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cafe-diff {
  --dc: var(--c-lav);
  min-height: 44px;
  padding: 8px 2px 9px;
  font: clamp(11px, 3.1vw, 13px)/1 var(--c-loud) !important;
  letter-spacing: 0.03em;
  color: var(--dc) !important;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid color-mix(in srgb, var(--dc) 55%, transparent);
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.cafe-diff.d-easy { --dc: var(--c-mint); }
.cafe-diff.d-normal { --dc: var(--c-sky); }
.cafe-diff.d-hard { --dc: var(--c-hot); }
.cafe-diff.d-idol { --dc: var(--c-lav); }
.cafe-diff:active { transform: scale(0.94); }

.cafe-diff.is-on {
  color: var(--c-night) !important;
  background: var(--dc);
  border-color: #fff;
  box-shadow: 0 0 16px color-mix(in srgb, var(--dc) 70%, transparent);
}

/* ---------- Board ---------- */

.cafe-board {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 166, 255, 0.4) transparent;
  background: rgba(22, 11, 46, 0.45);
  border: 1px solid var(--c-line);
  border-radius: 18px;
}

.cafe-board-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 8px;
  background: #1f0f3d;
  border-radius: 17px 17px 0 0;
}

.cafe-board-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
  background: linear-gradient(#1f0f3d, rgba(31, 15, 61, 0));
  pointer-events: none;
}

.cafe-board-label {
  font: 13px/1 var(--c-loud);
  letter-spacing: 0.08em;
  color: var(--c-lav);
}

.cafe-board-count { font-size: 12px; color: var(--c-faint); }
.cafe-board.is-stale .cafe-board-label::after { content: " · offline"; color: var(--c-hot); }

.cafe-list {
  margin: 0;
  padding: 0 8px 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cafe-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 14px;
  animation: cafe-in 0.38s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}

.cafe-board.no-anim .cafe-row { animation: none; }

@keyframes cafe-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.cafe-rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  justify-self: center;
  font: 17px/1 var(--c-loud);
  color: var(--c-soft);
}

.cafe-rank i {
  font: normal 10px/1 var(--c-cute);
  margin: 5px 0 0 1px;
}

.is-top1 .cafe-rank,
.is-top2 .cafe-rank,
.is-top3 .cafe-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-night);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(0, 0, 0, 0.35);
}

.is-top1 .cafe-rank { background: radial-gradient(circle at 35% 30%, #fff6c4, var(--c-butter) 45%, #f0a623); box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255, 224, 102, 0.7); }
.is-top2 .cafe-rank { background: radial-gradient(circle at 35% 30%, #fff, #dcd3ff 50%, #9f8de8); }
.is-top3 .cafe-rank { background: radial-gradient(circle at 35% 30%, #ffe1cc, #ffad80 50%, #d9673a); }
.is-top1 { background: linear-gradient(90deg, rgba(255, 224, 102, 0.16), rgba(255, 255, 255, 0.04) 70%); }

.cafe-who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cafe-row-name {
  display: flex;
  min-width: 0;
  font-size: 16px;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Only the words ellipsize: the #number tells same-named fans apart. */
.cafe-row-base { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cafe-row-num { flex: none; margin-left: 0.3em; }

.cafe-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-soft);
  white-space: nowrap;
  overflow: hidden;
}

.cafe-grade {
  min-width: 24px;
  padding: 2px 5px 2px;
  font: 12px/1 var(--c-loud);
  text-align: center;
  color: var(--c-night);
  background: var(--c-lav);
  border-radius: 5px;
}

.cafe-grade.g-splus { background: linear-gradient(135deg, var(--c-hot), var(--c-butter)); }
.cafe-grade.g-s { background: var(--c-hot); color: #fff; }
.cafe-grade.g-a { background: var(--c-lav); }
.cafe-grade.g-b { background: var(--c-mint); }
.cafe-grade.g-c { background: var(--c-sky); }
.cafe-grade.g-f { background: rgba(255, 255, 255, 0.25); color: #fff; }

.cafe-badge {
  padding: 2px 5px 2px;
  font: 10px/1 var(--c-loud);
  letter-spacing: 0.04em;
  color: var(--c-mint);
  border: 1.5px solid var(--c-mint);
  border-radius: 5px;
}

.cafe-badge.is-ap {
  color: var(--c-night);
  background: linear-gradient(135deg, var(--c-butter), #ffb3d6);
  border-color: #fff;
}

.cafe-combo { color: var(--c-faint); }

.cafe-score {
  font: 19px/1 var(--c-loud);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: #fff;
}

.is-top1 .cafe-score { color: #fff6c4; text-shadow: 0 0 10px rgba(255, 224, 102, 0.5); }

/* You */
.cafe-row.is-me {
  background: linear-gradient(90deg, rgba(255, 79, 163, 0.5), rgba(176, 108, 255, 0.32));
  box-shadow: 0 0 0 2px var(--c-hot), 0 0 22px rgba(255, 79, 163, 0.55);
  animation: cafe-in 0.38s cubic-bezier(0.2, 0.8, 0.3, 1.2) both, cafe-me-glow 1.8s ease-in-out 0.5s infinite;
  animation-delay: calc(var(--i, 0) * 26ms), 0.6s;
}

.cafe-board.no-anim .cafe-row.is-me { animation: cafe-me-glow 1.8s ease-in-out infinite; }

@keyframes cafe-me-glow {
  50% { box-shadow: 0 0 0 2px #fff, 0 0 30px rgba(255, 79, 163, 0.8); }
}

.cafe-me-tag {
  align-self: flex-start;
  margin-bottom: -1px;
  padding: 2px 6px;
  font: 10px/1 var(--c-loud);
  letter-spacing: 0.06em;
  color: var(--c-hot);
  background: #fff;
  border-radius: 5px;
}

.cafe-row.is-me .cafe-rank { color: #fff; }
.cafe-row.is-me .cafe-meta { color: rgba(255, 255, 255, 0.85); }

.cafe-gap {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
}

.cafe-gap span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-faint);
}

/* Loading ghosts */
.cafe-row.is-ghost { animation: cafe-pulse 1.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 80ms); }
.cafe-ghost-bar { height: 14px; width: 70%; border-radius: 7px; background: rgba(255, 255, 255, 0.1); }
.cafe-ghost-score { height: 16px; width: 64px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); }
.cafe-row.is-ghost .cafe-rank { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }

@keyframes cafe-pulse { 50% { opacity: 0.45; } }

/* Empty / napping / loading message */
.cafe-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 20px 20px;
  text-align: center;
}

.cafe-state:empty { display: none; }
.cafe-board.is-loading .cafe-state { padding-top: 4px; }
.cafe-board.is-nap .cafe-state,
.cafe-board.is-empty .cafe-state {
  min-height: calc(100% - 52px);
  justify-content: center;
  padding-top: 12px;
}

.cafe-state-title {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
  color: #fff;
}

.cafe-state-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-soft);
}

.cafe-empty-stick {
  width: 64px;
  height: 64px;
  transform: rotate(-14deg);
  filter: drop-shadow(0 0 14px rgba(255, 79, 163, 0.6));
  animation: cafe-bob 2.4s ease-in-out infinite;
}

@keyframes cafe-bob { 50% { transform: rotate(8deg) translateY(-4px); } }

.cafe-nap-art {
  position: relative;
  width: min(200px, 56vw);
}

.cafe-nap-bear {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(185, 166, 255, 0.35));
  animation: cafe-breathe 3.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes cafe-breathe { 50% { transform: scale(1.025, 0.985); } }

.cafe-zzz {
  position: absolute;
  top: -6px;
  right: 2px;
  font: 22px/1 var(--c-loud);
  color: var(--c-lav);
}

.cafe-zzz span {
  position: absolute;
  opacity: 0;
  animation: cafe-z 3s ease-out infinite;
}

.cafe-zzz span:nth-child(2) { animation-delay: 1s; font-size: 0.8em; }
.cafe-zzz span:nth-child(3) { animation-delay: 2s; font-size: 1.2em; }

@keyframes cafe-z {
  0% { opacity: 0; transform: translate(0, 10px) rotate(-10deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(26px, -34px) rotate(12deg); }
}

.cafe-retry {
  margin-top: 12px;
  padding: 11px 22px 12px;
  font: 17px/1 var(--c-loud) !important;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--c-hot), #b06cff);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55) inset, 0 6px 24px rgba(255, 79, 163, 0.45);
  transition: transform 0.12s;
}

.cafe-retry:hover { transform: scale(1.05); }
.cafe-retry:active { transform: scale(0.96); }

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

.cafe-foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.cafe-you {
  min-height: 44px;
  padding: 7px 12px 8px;
  font-size: 14px !important;
  background: rgba(255, 79, 163, 0.14);
  border: 1.5px solid rgba(255, 79, 163, 0.7);
  border-radius: 999px;
}

.cafe-you:disabled { cursor: default; color: var(--c-soft) !important; background: rgba(255, 255, 255, 0.05); border-color: var(--c-line); }
.cafe-you-rank { font-family: var(--c-loud); color: var(--c-hot); letter-spacing: 0.02em; }
.cafe-you-stale { color: var(--c-faint); }

.cafe-queue {
  padding: 7px 12px 8px;
  font-size: 13px !important;
  color: var(--c-night) !important;
  background: var(--c-sky);
  border: 0;
  border-radius: 999px;
}

.cafe-queue.is-busy { opacity: 0.6; }

.cafe-tip {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--c-faint);
}

/* ---------- Desktop side cards (hidden on phone) ---------- */

.cafe-youcard,
.cafe-beartip { display: none; }

.cafe-youcard {
  position: relative;
  grid-template-columns: auto 1fr;
  grid-template-areas: "label label" "rank of" "best best";
  align-items: baseline;
  column-gap: 10px;
  row-gap: 4px;
  padding: 14px 16px 15px;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.24), rgba(176, 108, 255, 0.16));
  border: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 2px rgba(255, 79, 163, 0.75), 0 0 26px rgba(255, 79, 163, 0.22);
  transition: transform 0.12s;
}

.cafe-youcard:not(:disabled):hover { transform: translateY(-2px); }
.cafe-youcard.is-none { background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1.5px var(--c-line); cursor: default; }

.cafe-yc-label {
  grid-area: label;
  font: 12px/1 var(--c-loud);
  letter-spacing: 0.1em;
  color: var(--c-hot);
}

.cafe-yc-rank {
  grid-area: rank;
  font: 44px/1 var(--c-loud);
  font-weight: 400;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 79, 163, 0.7);
}

.cafe-yc-rank.is-podium { color: #fff6c4; text-shadow: 0 0 18px rgba(255, 224, 102, 0.8); }
.cafe-youcard.is-none .cafe-yc-rank { color: var(--c-faint); text-shadow: none; }

.cafe-yc-of {
  grid-area: of;
  font-size: 14px;
  line-height: 1.3;
  color: var(--c-soft);
}

.cafe-yc-best {
  grid-area: best;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--c-soft);
}

.cafe-yc-best b { font: 18px/1 var(--c-loud); font-weight: 400; color: #fff; letter-spacing: 0.02em; }

.cafe-beartip {
  align-items: flex-end;
  gap: 4px;
  margin-top: auto;
}

.cafe-beartip-bear {
  flex: none;
  width: 74px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 79, 163, 0.35));
  animation: cafe-sway 4s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes cafe-sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.cafe-beartip-text {
  position: relative;
  margin: 0 0 22px 10px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: #3a1a5c;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 3px var(--c-hot), 0 0 20px rgba(255, 79, 163, 0.45);
}

.cafe-beartip-text::before {
  content: "";
  position: absolute;
  left: -12px;
  bottom: 12px;
  border-style: solid;
  border-width: 7px 12px 7px 0;
  border-color: transparent #fff transparent transparent;
  filter: drop-shadow(-3px 0 0 var(--c-hot));
}

/* ---------- Phone: tighter ---------- */

/* Tablets in portrait: a centred column instead of a stretched one. */
@media (min-width: 600px) and (max-width: 859px) {
  .cafe-bar,
  .cafe-body { width: min(100%, 620px); align-self: center; }
}

@media (max-height: 700px) and (max-width: 859px) {
  .cafe-tip { display: none; }
  .cafe-me { grid-template-areas: "name row"; padding-top: 7px; padding-bottom: 7px; }
  .cafe-me-head { display: none; }
  .cafe-name { font-size: 21px; }
  .cafe-reroll-word { display: none; } /* the dice says it */
  .cafe-tab { padding: 8px 6px 9px; }
  .cafe-daily { padding: 6px; }
  .cafe-cover { width: 56px; height: 56px; }
  .cafe-daily { grid-template-columns: 56px 1fr; }
}

/* ---------- Landscape phones: pickers | board side by side (stacked, the board had no room) ---------- */

@media (max-height: 500px) and (orientation: landscape) {
  .cafe-bar { margin-bottom: 6px; }
  .cafe-bar,
  .cafe-body { width: 100%; align-self: stretch; }
  .cafe-body { flex-direction: row; gap: 12px; }
  .cafe-side { flex: 0 0 44%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .cafe-side::-webkit-scrollbar { display: none; }
  .cafe-main { min-width: 0; }
  .cafe-songs { margin: 0; padding: 3px 2px 5px; }
}

/* ---------- Desktop: sidebar + board ---------- */

@media (min-width: 860px) {
  .cafe { align-items: center; }

  .cafe-bar,
  .cafe-body {
    width: min(100%, 1060px);
  }

  .cafe-bar { margin-bottom: 16px; }

  .cafe-body {
    flex-direction: row;
    gap: 22px;
    max-height: 760px;
  }

  .cafe-side {
    width: 360px;
    gap: 14px;
  }

  .cafe-me {
    grid-template-areas: "head row" "name name";
    row-gap: 8px;
    padding: 14px 14px 16px 18px;
  }

  .cafe-name { font-size: 28px; }

  .cafe-songs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .cafe-song { padding: 6px 14px 6px 9px; border-radius: 12px; }
  .cafe-song-kr { display: inline; }
  .cafe-side { min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
  .cafe-side::-webkit-scrollbar { display: none; }
  .cafe-youcard { display: grid; }
  .cafe-beartip { display: flex; }
  .cafe-you,
  .cafe-tip { display: none; }
  .cafe-foot:not(:has(.cafe-queue:not([hidden]))) { display: none; }

  .cafe-daily { grid-template-columns: 96px 1fr; padding: 10px; }
  .cafe-cover { width: 96px; height: 96px; }
  .cafe-cover-kr { font-size: 24px; }
  .cafe-daily-album { font-size: 22px; }
  .cafe-diff { padding: 10px 2px 11px; font-size: 13px !important; }

  .cafe-main { gap: 10px; }
  .cafe-row { min-height: 58px; grid-template-columns: 48px minmax(0, 1fr) auto; padding: 7px 18px 7px 8px; gap: 14px; }
  .cafe-rank { width: 40px; height: 40px; font-size: 19px; }
  .cafe-row-name { font-size: 18px; }
  .cafe-score { font-size: 22px; }
  .cafe-board-head { padding: 14px 18px 10px; }
  .cafe-list { padding: 0 12px 14px; }
  .cafe-tip { flex: 1 1 auto; text-align: right; }
}

@media (min-width: 860px) and (max-height: 820px) {
  .cafe-beartip { display: none !important; }
  .cafe-foot:not(:has(.cafe-queue:not([hidden]))) { display: flex; }
  .cafe-tip { display: block; flex: 1 1 auto; text-align: right; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .cafe *,
  .cafe *::before,
  .cafe *::after {
    animation: none !important;
    transition: none !important;
  }
}

.reduce-motion .cafe *,
.reduce-motion .cafe *::before,
.reduce-motion .cafe *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- 404: omo! stage not found ---------- */

.omo404 {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  color: var(--c-text);
  font-family: var(--c-cute);
  text-align: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(185, 166, 255, 0.28), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 100%, rgba(255, 79, 163, 0.22), transparent 70%),
    linear-gradient(#160b2e, #2e1257 70%, #1c0a35);
  overflow-x: hidden;
}

.omo404 main {
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.omo404 .onair404 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 5px 8px;
  font: 14px/1 var(--c-loud);
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--c-hot);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(255, 79, 163, 0.6);
}

.omo404 .onair404 span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: cafe-blink 1s steps(1) infinite;
}

.omo404 .bear404 {
  width: min(220px, 60vw);
  height: auto;
  margin: 18px 0 -8px;
  filter: drop-shadow(0 0 26px rgba(255, 79, 163, 0.35));
  animation: omo-tilt 3.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes cafe-blink { 50% { opacity: 0.25; } }

@keyframes omo-tilt {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.omo404 h1 {
  margin: 0;
  font: 400 clamp(84px, 26vw, 170px)/1 var(--c-cute);
  letter-spacing: 0.04em;
  color: #fff7fc;
  transform: skewX(-7deg);
}

.omo404 h1 span {
  display: inline-block;
  --glow: var(--c-hot);
  text-shadow: 0 0 0.04em #fff, 0 0 0.1em var(--glow), 0 0 0.28em var(--glow), 0 0 0.6em var(--glow);
  animation: omo-drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.omo404 h1 span:nth-child(2) { --glow: var(--c-lav); animation-delay: 0.08s; }
.omo404 h1 span:nth-child(3) { --glow: var(--c-mint); animation-delay: 0.16s; }
.omo404 h1 span:nth-child(4) { --glow: var(--c-sky); animation-delay: 0.24s; }

@keyframes omo-drop {
  from { transform: translateY(-0.5em) scale(1.4); opacity: 0; }
}

.omo404 .lost {
  margin: 4px 0 0;
  font: clamp(22px, 6vw, 30px)/1.1 var(--c-loud);
  letter-spacing: 0.04em;
}

.omo404 .quip {
  position: relative;
  margin: 18px 0 0;
  padding: 12px 18px;
  font-size: 17px;
  line-height: 1.4;
  color: #3a1a5c;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 0 0 3px var(--c-hot), 0 0 24px rgba(255, 79, 163, 0.5);
}

.omo404 .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.omo404 .links a {
  padding: 12px 22px 13px;
  font: 18px/1 var(--c-cute);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.12s;
}

.omo404 .links a:hover { transform: scale(1.05); }
.omo404 .links a:focus-visible { outline: 3px solid var(--c-butter); outline-offset: 3px; }

.omo404 .links .go {
  font-family: var(--c-loud);
  letter-spacing: 0.03em;
  color: #2a0f3d;
  background: linear-gradient(135deg, var(--c-butter), #ffb3d6 55%, var(--c-hot));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75) inset, 0 8px 28px rgba(255, 79, 163, 0.5);
}

.omo404 .links .home {
  background: rgba(22, 11, 46, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55) inset;
}

.omo404 .code {
  margin-top: 30px;
  font-size: 13px;
  color: var(--c-faint);
}

@media (prefers-reduced-motion: reduce) {
  .omo404 *,
  .omo404 *::before { animation: none !important; transition: none !important; }
}
