/* Name 100 Challenge — "party game" theme override (pilot: index.html + play-men.html)
   Loaded AFTER styles.css. Cartoon party look: chunky capsule shapes, candy colors,
   bouncy motion. DOM unchanged; per-variant --accent still driven by inline body style. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --party-bg1: #7c3aed;   /* vivid violet */
  --party-bg2: #5b21b6;   /* deep violet */
  --party-ink: #2e1065;   /* purple ink for outlines */
  --party-yellow: #ffd23f;
  --party-pink: #ff4d8d;
  --party-teal: #2dd4bf;
  --display: "Fredoka", "Outfit", system-ui, sans-serif;
}

body {
  background: linear-gradient(160deg, var(--party-bg1), var(--party-bg2) 70%) fixed;
  background-color: var(--party-bg2);
  /* confetti dots */
  background-image:
    radial-gradient(circle, rgba(255, 210, 63, 0.35) 2px, transparent 2.6px),
    radial-gradient(circle, rgba(255, 77, 141, 0.30) 2px, transparent 2.6px),
    radial-gradient(circle, rgba(45, 212, 191, 0.30) 2px, transparent 2.6px),
    linear-gradient(160deg, var(--party-bg1), var(--party-bg2) 70%);
  background-size: 90px 90px, 130px 130px, 110px 110px, cover;
  background-position: 0 0, 45px 60px, 20px 30px, 0 0;
  background-attachment: fixed;
  color: var(--ink);
}

/* ---------- header ---------- */
.site-header {
  background: rgba(30, 12, 64, 0.92);
  border-bottom: 4px solid var(--party-yellow);
}
.logo { font-family: var(--display); font-weight: 600; font-size: 18px; }
.logo svg { transition: transform 0.25s ease; }
.logo:hover svg { transform: rotate(-10deg) scale(1.12); }
.site-nav a { font-family: var(--display); font-weight: 500; }
.site-nav a:hover { border-bottom-color: var(--party-yellow); }

/* ---------- hero ---------- */
.hero { background: none; padding: 44px 0 24px; }
.hero h1 {
  font-family: var(--display); font-weight: 700; color: #ffffff;
  text-shadow: 3px 3px 0 rgba(30, 12, 64, 0.55);
  letter-spacing: -0.02em;
}
.hero .hl {
  background: var(--party-yellow); color: var(--party-ink);
  border: 3px solid var(--party-ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(30, 12, 64, 0.8);
  animation: hl-float 3s ease-in-out infinite;
}
@keyframes hl-float {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-1deg) translateY(-6px); }
}
.hero p.lede, .page .lede { color: rgba(255, 255, 255, 0.85); }

/* ---------- cards (homepage directory) ---------- */
.card {
  border: 3px solid var(--party-ink); border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(30, 12, 64, 0.45);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}
.card:hover {
  transform: translate(-3px, -4px) rotate(-0.6deg);
  box-shadow: 9px 10px 0 var(--party-pink);
}
.card h2 { font-family: var(--display); font-weight: 600; }

/* ---------- sections / prose on purple ---------- */
.page h1, section > h2 { font-family: var(--display); font-weight: 700; color: #ffffff; text-shadow: 2px 2px 0 rgba(30, 12, 64, 0.5); }
.prose p { color: rgba(255, 255, 255, 0.88); }
.prose strong { color: var(--party-yellow); }
.prose a { color: #9df0ff; }
.steps li, details.faq, .rules-list { border: 3px solid var(--party-ink); border-radius: 18px; box-shadow: 5px 5px 0 rgba(30, 12, 64, 0.45); }
.steps li::before { border-radius: 10px; }

/* ---------- buttons: bouncy capsules ---------- */
.btn {
  font-family: var(--display); font-weight: 600; border-radius: 999px;
  border: 3px solid var(--party-ink); padding: 12px 26px;
  box-shadow: 0 5px 0 rgba(30, 12, 64, 0.55);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 0 rgba(30, 12, 64, 0.55); }
.btn:active { transform: translateY(2px) scale(0.97); box-shadow: 0 1px 0 rgba(30, 12, 64, 0.55); }
.btn-accent { background: linear-gradient(180deg, #ff6ba4, var(--party-pink)); color: #fff; text-shadow: 1px 1px 0 rgba(30, 12, 64, 0.4); }
.btn-secondary { background: #fff; }

/* ---------- variant picker: party app-icon cards ---------- */
.variant-chips { gap: 12px; }
.chip {
  border: 3px solid var(--party-ink); border-radius: 18px;
  box-shadow: 0 5px 0 rgba(30, 12, 64, 0.45);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
}
.chip-emoji { filter: drop-shadow(0 2px 0 rgba(30, 12, 64, 0.35)); }
.chip-name { font-family: var(--display); font-weight: 600; font-size: 0.88rem; }
.chip-badge { border: 2px solid var(--party-ink); box-shadow: 0 2px 0 rgba(30, 12, 64, 0.35); }
.chip:hover { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 9px 0 rgba(30, 12, 64, 0.45); }
.chip.on {
  transform: scale(1.07);
  box-shadow: 0 5px 0 var(--party-ink);
  outline: 3px solid var(--party-yellow); outline-offset: 2px;
  animation: chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chip-pop { 0% { transform: scale(0.85); } 100% { transform: scale(1.07); } }

/* ---------- mode toggle: party capsule segmented control ---------- */
.mode-toggle button {
  border: 3px solid var(--party-ink); border-radius: 0;
  font-family: var(--display); font-weight: 500; font-size: 0.95rem;
  padding: 9px 20px; background: #ffffff;
  box-shadow: 0 4px 0 rgba(30, 12, 64, 0.45);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
}
.mode-toggle button:hover { transform: translateY(-2px); }
.mode-toggle button:first-child { border-radius: 999px 0 0 999px; }
.mode-toggle button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.mode-toggle button.on {
  background: var(--accent); color: var(--on-accent);
  border-color: var(--party-ink);
  box-shadow: 0 4px 0 var(--party-ink);
}

/* ---------- game panel ---------- */
.game-panel {
  border: 3px solid var(--party-ink); border-radius: 22px;
  box-shadow: 8px 8px 0 rgba(30, 12, 64, 0.5);
}
.play-head h1 { font-family: var(--display); font-weight: 700; color: #ffffff; text-shadow: 3px 3px 0 rgba(30, 12, 64, 0.55); }
.play-head .rule-line, .play-links a { color: rgba(255, 255, 255, 0.8); }
.play-links a:hover { color: var(--party-yellow); }

.timer { font-family: var(--display); font-weight: 700; }
.score-chip {
  font-family: var(--display); border: 3px solid var(--party-ink);
  border-radius: 16px; background: #fff;
  box-shadow: 0 4px 0 rgba(30, 12, 64, 0.35);
}

/* progress: candy stripes */
.progress { height: 18px; border: 3px solid var(--party-ink); border-radius: 999px; background: #fff; }
.progress > div {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, rgba(255, 255, 255, 0.35) 14px 28px);
  background-color: var(--accent);
  border-radius: 999px;
  animation: stripes 1.2s linear infinite;
}
@keyframes stripes { to { background-position: 39.6px 0; } }

.entry-form input { border: 3px solid var(--party-ink); border-radius: 16px; }
.entry-form input:focus { box-shadow: 0 0 0 4px var(--party-yellow); }
.entry-form .btn { background: var(--accent-dark); }

.entries { border: 3px solid var(--party-ink); border-radius: 16px; background: #fdf9ff; }
.entries li { animation: entry-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes entry-pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* quick tag chips + group chips: mini capsules */
.tag-chip, .group-chip {
  font-family: var(--display); font-weight: 500;
  border-radius: 999px !important;
}
.tag-chip { transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tag-chip:hover { transform: scale(1.1) rotate(-2deg); }

/* toast: bounce in */
.game-toast { animation: toast-bounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes toast-bounce { 0% { transform: translate(-50%, -16px) scale(0.7); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* end screen */
.end-score { font-family: var(--display); font-weight: 700; }

/* legends: party card */
.legends { border: 3px solid var(--party-ink); border-radius: 18px; box-shadow: 6px 6px 0 rgba(30, 12, 64, 0.45); }
.legends-title { font-family: var(--display); font-weight: 600; }
.legends-tab { border-radius: 999px; font-family: var(--display); font-weight: 500; }

/* beat banner */
.beat-banner { border-radius: 16px; border: 3px solid var(--party-ink); }

/* ---------- footer ---------- */
.site-footer { background: rgba(30, 12, 64, 0.95); border-top: 4px solid var(--party-yellow); }

/* keep motion accessible */
@media (prefers-reduced-motion: reduce) {
  .hero .hl, .progress > div, .chip.on, .entries li, .game-toast { animation: none; }
}

/* ============ round 2: game-feel components ============ */

/* confetti canvas */
.party-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* theme emoji badge above the title */
#party-emoji {
  display: block; font-size: 3.2rem; line-height: 1; margin-bottom: 6px;
  animation: emoji-bob 2.4s ease-in-out infinite;
  filter: drop-shadow(3px 3px 0 rgba(30, 12, 64, 0.45));
}
@keyframes emoji-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-9px) rotate(6deg); }
}

/* answers as collect-'em-all sticker tiles */
.entries {
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  columns: unset; padding: 14px;
}
.entries li {
  font-family: var(--display); font-weight: 500; font-size: 0.92rem;
  border: 2.5px solid var(--party-ink); border-radius: 12px;
  padding: 5px 11px; box-shadow: 2.5px 2.5px 0 rgba(30, 12, 64, 0.4);
  background: #fff;
}
.entries li::before { content: none; }
.entries li:nth-child(4n+1) { background: #fff3c4; transform: rotate(-1.2deg); }
.entries li:nth-child(4n+2) { background: #ffd9e8; transform: rotate(1deg); }
.entries li:nth-child(4n+3) { background: #c9f5ee; transform: rotate(-0.8deg); }
.entries li:nth-child(4n+4) { background: #e6dcff; transform: rotate(1.2deg); }
.entries li:has(.tag-chips) { flex-basis: 100%; transform: none; background: #fff; }

/* mascot empty state */
.entries:empty { display: block; text-align: center; padding: 26px 14px 20px; }
.entries:empty::before {
  content: "🧠"; display: block; font-size: 3rem; margin-bottom: 6px;
  animation: emoji-bob 2.4s ease-in-out infinite;
}
.entries:empty::after { font-style: normal; font-family: var(--display); font-weight: 500; }

/* milestone flash (25/50/75/100) */
.party-milestone {
  position: fixed; left: 50%; top: 34%; z-index: 9998;
  transform: translate(-50%, -50%) scale(0.4) rotate(-8deg);
  font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 12vw, 5.5rem);
  color: var(--party-yellow);
  text-shadow: 4px 4px 0 var(--party-ink), -2px -2px 0 var(--party-ink), 2px -2px 0 var(--party-ink), -2px 2px 0 var(--party-ink);
  pointer-events: none; opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.party-milestone.go { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }

/* end screen star rating */
.party-stars { font-size: 2.6rem; letter-spacing: 8px; margin: 4px 0 2px; }
.party-stars span {
  color: #d9d3e8; -webkit-text-stroke: 2px var(--party-ink);
  display: inline-block;
}
.party-stars span.lit {
  color: var(--party-yellow);
  filter: drop-shadow(2px 3px 0 rgba(30, 12, 64, 0.5));
  animation: star-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.party-stars span.lit:nth-child(2) { animation-delay: 0.15s; }
.party-stars span.lit:nth-child(3) { animation-delay: 0.3s; }
@keyframes star-pop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  #party-emoji, .entries:empty::before { animation: none; }
  .party-stars span.lit { animation: none; }
}

/* ---------- content pages with embedded game (name-100-*.html) ---------- */
/* main.play.page reuses the play grid, but prose/sections must stay full-width;
   only the game panel and the leaderboard share a grid row. */
@media (min-width: 1024px) {
  main.play.page > :not(.game-panel):not(.legends) { grid-column: 1 / -1; }
  main.play.page > .game-panel { grid-column: 1; min-width: 0; }
  main.play.page > .legends { grid-column: 2; margin-top: 22px; }
}

/* custom tile icons: white stroke + soft shadow on gradient tiles */
.chip .chip-icon svg { stroke: #fff; filter: drop-shadow(2px 2px 0 rgba(30, 12, 64, 0.4)); }
.chip-name { margin-top: 6px; }

/* title badge: SVG icon instead of emoji */
#party-emoji svg { width: 3.2rem; height: 3.2rem; stroke: #fff; stroke-width: 2; fill: none; }

/* ============ facts.js: person fact card + hall of fame ============ */

/* fact card under the feedback line: white sticker with ink outline */
.facts-card {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 2px 0 12px; padding: 12px 14px;
  background: #fff; border: 3px solid var(--party-ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(30, 12, 64, 0.45);
  animation: facts-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.5s ease;
}
.facts-card.fade { opacity: 0; }
@keyframes facts-pop {
  0% { transform: scale(0.7) rotate(-2deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.facts-avatar {
  width: 48px; height: 48px; flex: none; object-fit: cover;
  border: 2.5px solid var(--party-ink); border-radius: 12px;
  background: #e6dcff;
}
.facts-body { min-width: 0; }
.facts-name { display: block; font-family: var(--display); font-weight: 600; }
.facts-extract { margin: 2px 0 4px; font-size: 0.86rem; line-height: 1.4; overflow-wrap: break-word; }
.facts-via { font-size: 0.72rem; color: #8a7fb0; }

/* hall of fame grid on the end screen */
.facts-hall { margin: 0 0 18px; text-align: center; }
.facts-hall-title {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  margin: 0 0 10px;
}
.facts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.facts-tile {
  padding: 8px 6px 7px; min-width: 0;
  background: #fff; border: 2.5px solid var(--party-ink); border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(30, 12, 64, 0.4);
}
.facts-tile img {
  width: 64px; height: 64px; max-width: 100%; object-fit: cover;
  border-radius: 12px; border: 2px solid var(--party-ink);
  background: #e6dcff;
}
.facts-tile span {
  display: block; margin-top: 5px;
  font-family: var(--display); font-weight: 500; font-size: 0.78rem;
  line-height: 1.2; overflow-wrap: break-word;
}
.facts-more {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 0.85rem;
  border: 2.5px dashed var(--party-ink); border-radius: 14px;
  color: var(--party-ink); background: rgba(255, 255, 255, 0.55);
}

/* keep motion accessible */
@media (prefers-reduced-motion: reduce) {
  .facts-card { animation: none; }
  .facts-card.fade { transition: none; }
}

/* ============ daily.js: daily challenge card + streak ============ */

/* card above the variant chips: white sticker card with a rotated DAILY tag */
.daily-card {
  position: relative;
  margin: 0 0 18px; padding: 22px 18px 16px;
  background: #fff;
  border: 3px solid var(--party-ink); border-radius: 18px;
  box-shadow: 7px 7px 0 rgba(30, 12, 64, 0.45);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}
.daily-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 10px 11px 0 var(--party-pink);
}
.daily-card:focus-visible { outline: 3px solid var(--party-yellow); outline-offset: 2px; }
.daily-sticker {
  position: absolute; top: -13px; left: 16px;
  padding: 3px 12px;
  font-family: var(--display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em;
  color: var(--party-ink); background: var(--party-yellow);
  border: 2.5px solid var(--party-ink); border-radius: 9px;
  box-shadow: 2.5px 2.5px 0 rgba(30, 12, 64, 0.45);
  transform: rotate(-6deg);
}
.daily-head { display: flex; flex-direction: column; gap: 3px; }
.daily-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.daily-theme { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--party-ink); }
.daily-sub { font-size: 0.85rem; color: #6d6390; }

/* embedded mini leaderboard */
.daily-board {
  list-style: none; margin: 12px 0 0; padding: 10px 0 0;
  border-top: 2px dashed #d9d3e8;
}
.daily-board li {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 500; font-size: 0.92rem;
  padding: 3px 0;
}
.daily-rank {
  width: 24px; height: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  background: var(--party-ink); border-radius: 999px;
}
.daily-flag { font-size: 1.05rem; }
.daily-score { margin-left: auto; font-weight: 600; }
.daily-board-empty { justify-content: center; color: #6d6390; }

/* "your" lines on the card */
.daily-you { margin: 10px 0 0; font-family: var(--display); font-weight: 600; font-size: 0.92rem; }
.daily-card-streak { margin: 4px 0 0; font-family: var(--display); font-weight: 700; font-size: 1rem; color: #e0651f; }

/* streak line on the end screen (inserted after #end-best) */
.daily-streak-line {
  margin: -12px 0 14px;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: #e0651f;
}

@media (max-width: 560px) {
  .daily-card { padding: 20px 14px 14px; }
}

/* ============ audio.js: HUD mute toggle ============ */

/* small round party button pinned to the HUD's top-right (after the score chip) */
.audio-mute {
  width: 44px; height: 44px; flex: none; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; line-height: 1; padding: 0;
  background: #fff; border: 3px solid var(--party-ink); border-radius: 999px;
  box-shadow: 0 4px 0 rgba(30, 12, 64, 0.45);
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
}
.audio-mute:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 0 rgba(30, 12, 64, 0.45); }
.audio-mute:active { transform: translateY(1px) scale(0.96); box-shadow: 0 1px 0 rgba(30, 12, 64, 0.45); }
.audio-mute[aria-pressed="true"] { background: #e6dcff; }
@media (max-width: 560px) {
  .audio-mute { width: 40px; height: 40px; }
}

/* ============ leaderboard: nickname row + name/time columns ============ */

/* nickname input on the end screen: label over a capsule input + small save pill */
.lb-name {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
}
.lb-name-label {
  flex: 1 1 100%;
  font-family: var(--display); font-weight: 500; font-size: 0.85rem; color: #6d6390;
}
.lb-name-input {
  flex: 1 1 auto; min-width: 0; max-width: 180px;
  font-family: var(--display); font-weight: 500; font-size: 0.92rem;
  padding: 8px 14px; color: var(--party-ink);
  background: #fff; border: 3px solid var(--party-ink); border-radius: 999px;
  box-shadow: 0 3px 0 rgba(30, 12, 64, 0.35);
}
.lb-name-input:focus { outline: none; box-shadow: 0 0 0 4px var(--party-yellow); }
.lb-name-save {
  flex: none; padding: 8px 16px; font-size: 0.85rem;
  background: var(--party-yellow); color: var(--party-ink); text-shadow: none;
}
.lb-name-hint { font-size: 0.78rem; font-weight: 700; color: #2f9e6e; }
@media (max-width: 560px) {
  .lb-name-input { max-width: none; }
}

/* leaderboard rows: player name truncates with ellipsis, time sits under the score */
.legends-name {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.legends-name.anon { color: #8a7fb0; font-weight: 500; font-style: italic; }
.legends-score { flex: none; text-align: right; line-height: 1.15; }
.legends-time {
  display: block; font-size: 0.72rem; font-weight: 500; color: #8a7fb0;
  font-variant-numeric: tabular-nums;
}

/* ============ round 3: craft upgrade (design-reference pass) ============ */

/* --- hero floating answer tiles (homepage only, injected by party.js) --- */
.hero { position: relative; }
.hero-float {
  position: absolute; z-index: 0; pointer-events: none;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  background: #fff; color: var(--party-ink);
  border: 3px solid var(--party-ink); border-radius: 12px;
  padding: 8px 14px; box-shadow: 4px 4px 0 rgba(30, 12, 64, 0.5);
  animation: float-bob 3.6s ease-in-out infinite;
}
.hero > *:not(.hero-float) { position: relative; z-index: 1; }
@keyframes float-bob {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, -3deg)); }
  50% { transform: translateY(-12px) rotate(calc(var(--tilt, -3deg) + 2deg)); }
}
@media (max-width: 900px) { .hero-float { display: none; } }

/* --- score power-up flash every 10 named (rainbow gradient sweep) --- */
@keyframes powerup-flash {
  0% { transform: scale(1); }
  35% { transform: scale(1.18) rotate(-2deg); }
  100% { transform: scale(1); }
}
.score-chip.powerup {
  animation: powerup-flash 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(90deg, #76f4fc, #ff42e7, #fdff48, #ff42e7, #76f4fc);
  background-size: 300% 100%;
  animation: powerup-flash 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
             powerup-slide 0.9s linear;
}
.score-chip.powerup span, .score-chip.powerup small { color: var(--party-ink); }
@keyframes powerup-slide { to { background-position: 300% 0; } }

/* --- 3D push-button craft: rest offset, press to zero --- */
.btn {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(30, 12, 64, 0.55);
}
.btn:hover { transform: translate(-4px, -4px); box-shadow: 8px 8px 0 rgba(30, 12, 64, 0.55); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(30, 12, 64, 0); }

/* CTA arrow slide-in */
.btn-big::after {
  content: "→"; display: inline-block; max-width: 0; overflow: hidden;
  vertical-align: -0.1em; opacity: 0;
  transition: max-width 0.22s ease, opacity 0.22s ease, margin-left 0.22s ease;
}
.btn-big:hover::after { max-width: 1.4em; opacity: 1; margin-left: 10px; }

/* --- HUD craft: mini labels above values --- */
.timer { position: relative; }
.timer::before {
  content: "TIME"; display: block;
  font-family: var(--display); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 2.5px; color: var(--muted);
}
.hud { align-items: flex-end; }

/* --- border width scales with viewport (1600px+) --- */
@media (min-width: 1600px) {
  .game-panel, .legends, .card, .entries, .entry-form input { border-width: 4px; }
  .chip { border-width: 3.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-float { animation: none; }
  .score-chip.powerup { animation: none; }
  .btn-big::after { transition: none; }
}

/* ============ round 4: poster-card picker + arcade panel + fluidity ============
   Homepage variant chips become 3:4 photo poster cards (chip button contract
   unchanged: .chip[data-slug], .chip-badge). Game panel becomes a dark arcade
   cabinet screen. Sections separated by hairlines, directory cards tilted.
   All rules append-only; old rules above still govern legacy pages. */

/* --- variant picker: poster grid (desktop) --- */
.variant-chips {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px 16px;
  padding: 10px 4px 14px;
  margin: 0 0 18px;
}

#variant-chips .chip {
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--tile, var(--accent)), var(--tile-dark, var(--accent-dark)));
  transform: rotate(var(--tilt, 0deg));
  cursor: pointer;
}

/* fixed per-card tilt, no JS randomness (19 cards cycle every 6) */
#variant-chips .chip:nth-child(6n+1) { --tilt: -1.6deg; }
#variant-chips .chip:nth-child(6n+2) { --tilt: 1.2deg; }
#variant-chips .chip:nth-child(6n+3) { --tilt: -0.8deg; }
#variant-chips .chip:nth-child(6n+4) { --tilt: 1.8deg; }
#variant-chips .chip:nth-child(6n+5) { --tilt: -1.9deg; }
#variant-chips .chip:nth-child(6n)   { --tilt: 0.7deg; }

/* full-bleed photo cover; onerror in the markup hides it, gradient stays */
#variant-chips .chip-img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* bottom scrim so the name reads over any photo */
#variant-chips .chip::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10, 4, 26, 0) 36%, rgba(10, 4, 26, 0.52) 66%, rgba(10, 4, 26, 0.88) 100%);
}

#variant-chips .chip-badge { z-index: 2; }

#variant-chips .chip-name {
  position: absolute; left: 10px; right: 52px; bottom: 28px; z-index: 2;
  margin-top: 0;
  font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.12;
  color: #ffffff; text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
}

/* always-on translucent play button: the "this is clickable" affordance */
#variant-chips .chip-play {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; line-height: 1; color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  background: rgba(20, 9, 46, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease;
}

/* "Play now" caption appears under the name on hover/focus */
#variant-chips .chip-cta {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-family: var(--display); font-weight: 600; font-size: 0.7rem;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--party-yellow);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#variant-chips .chip:hover,
#variant-chips .chip:focus-visible {
  transform: rotate(var(--tilt, 0deg)) translateY(-6px);
  box-shadow: 0 11px 0 rgba(30, 12, 64, 0.45);
}
#variant-chips .chip:focus-visible {
  outline: 3px solid var(--party-yellow); outline-offset: 3px;
}
#variant-chips .chip:hover .chip-play,
#variant-chips .chip:focus-visible .chip-play {
  background: var(--tile, var(--accent));
  border-color: #ffffff;
  transform: scale(1.12);
}
#variant-chips .chip:hover .chip-cta,
#variant-chips .chip:focus-visible .chip-cta {
  opacity: 1; transform: translateY(0);
}

/* selected: straighten, yellow ring, slight grow */
#variant-chips .chip.on {
  transform: rotate(0deg) scale(1.05);
  outline: 3px solid var(--party-yellow); outline-offset: 2px;
  box-shadow: 0 8px 0 rgba(30, 12, 64, 0.5);
  z-index: 3;
  animation: chip-pop-poster 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chip-pop-poster {
  0% { transform: scale(0.85) rotate(0deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}

/* mobile: horizontal snap-scrolling poster rail, next card peeks in */
@media (max-width: 640px) {
  .variant-chips {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 8px 8px 14px;
    margin-left: -8px; margin-right: -8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .variant-chips::-webkit-scrollbar { display: none; }
  #variant-chips .chip { flex: 0 0 42vw; scroll-snap-align: start; }
  #variant-chips .chip-name { font-size: 0.92rem; }
}

/* --- arcade cabinet game panel --- */
.game-panel {
  background: linear-gradient(180deg, #1d0d40, #14092e 62%);
  border: 4px solid var(--party-ink);
  border-radius: 24px;
  box-shadow: 10px 10px 0 rgba(20, 7, 45, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

/* HUD: cabinet screen readouts */
.game-panel .timer {
  color: var(--party-yellow);
  text-shadow: 0 0 16px rgba(255, 210, 63, 0.4), 2px 2px 0 rgba(0, 0, 0, 0.55);
}
.game-panel .timer.low {
  color: #ff5c7a;
  text-shadow: 0 0 16px rgba(255, 92, 122, 0.5), 2px 2px 0 rgba(0, 0, 0, 0.55);
}
.game-panel .timer::before { color: rgba(255, 255, 255, 0.5); }
.game-panel .score-chip {
  background: rgba(0, 0, 0, 0.38);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.game-panel .score-chip small { color: rgba(255, 255, 255, 0.55); }

/* progress: dark track, candy stripe fill unchanged */
.game-panel .progress {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.14);
}

/* pill input inset into the panel */
.game-panel .entry-form input {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}
.game-panel .entry-form input::placeholder { color: rgba(255, 255, 255, 0.45); }
.game-panel .entry-form input:focus {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 4px var(--party-yellow);
}

/* wrong answer: input shake (class toggled by party.js observing #feedback) */
@keyframes entry-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
#entry.shake { animation: entry-shake 0.3s ease; }

.game-panel .feedback { color: rgba(255, 255, 255, 0.85); }
.game-panel .feedback.ok { color: #6ee7a8; }
.game-panel .feedback.err { color: #ff8fab; }
.game-panel .feedback.hint { color: rgba(255, 255, 255, 0.5); }

/* answers tray: dark inset, pastel sticker tiles pop on it */
.game-panel .entries {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}
.game-panel .entries:empty::after { color: rgba(255, 255, 255, 0.45); }

/* picture mode stage + 150ms cross-fade between images */
.game-panel .guess-stage {
  background: #0d0520;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}
.guess-stage img { transition: opacity 0.15s ease; }

/* ghost buttons stay visible on the dark panel */
.game-panel .btn-ghost { color: rgba(255, 255, 255, 0.65); }
.game-panel .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }

/* end screen on dark */
.game-panel .end-screen { color: rgba(255, 255, 255, 0.85); }
.game-panel .end-score { color: #ffffff; }
.game-panel .end-score span { color: rgba(255, 255, 255, 0.5); }
.game-panel .end-meta, .game-panel .end-missed { color: rgba(255, 255, 255, 0.6); }
.game-panel .end-best { color: #ffffff; }
.game-panel .end-compare { color: var(--party-yellow); }
.game-panel .facts-hall-title { color: #ffffff; }
.game-panel .lb-name-label { color: rgba(255, 255, 255, 0.55); }

/* variant / mode switch: 200ms panel fade-in (class toggled by party.js) */
.game-panel.panel-swap { animation: panel-in 0.2s ease; }
@keyframes panel-in { 0% { opacity: 0; } 100% { opacity: 1; } }

/* --- de-boxing: hairline section dividers instead of stacked white cards --- */
main > section { border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 28px; }

/* directory cards: gentle alternating tilt, straighten on hover */
.cards > .card:nth-child(odd) { transform: rotate(-0.7deg); }
.cards > .card:nth-child(even) { transform: rotate(0.7deg); }
.cards > .card:hover { transform: rotate(0deg) translate(-3px, -4px); }

@media (prefers-reduced-motion: reduce) {
  #entry.shake, .game-panel.panel-swap, #variant-chips .chip.on { animation: none; }
  .guess-stage img, #variant-chips .chip, #variant-chips .chip-play,
  #variant-chips .chip-cta { transition: none; }
}

/* ============ round 5: dark arcade everywhere ============
   Round 4's dark cabinet screen spreads site-wide: the legends panel becomes
   a machine high-score table, the end screen an arcade results screen, the
   daily card a photo poster, the footer gains an oversized wordmark, and the
   long-form content pages get warm paper "cabinet manual" reading panels.
   Append-only; every older rule above still applies. */

/* ---------- legends: cabinet high-score table ---------- */
.legends {
  background: linear-gradient(180deg, #1d0d40, #14092e 62%);
  border: 4px solid var(--party-ink);
  border-radius: 20px;
  box-shadow: 16px 16px 0 rgba(20, 7, 45, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.05);
  padding: 16px 16px 12px;
}
.legends-title { color: #ffffff; font-weight: 700; letter-spacing: 0.03em; }
.legends-live { color: rgba(255, 255, 255, 0.45); }

/* tabs: small uppercase capsules, selected = yellow on ink */
.legends-tab {
  font-family: var(--display); font-weight: 600;
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: transparent; color: rgba(255, 255, 255, 0.55);
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.legends-tab:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.45); }
.legends-tab.on {
  background: var(--party-yellow); color: var(--party-ink);
  border-color: var(--party-ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}

/* rows on the dark screen */
.legends-list li { padding: 7px 8px; }
.legends-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.legends-rank { color: rgba(255, 255, 255, 0.4); }
.legends-name { color: rgba(255, 255, 255, 0.92); }
.legends-name.anon { color: rgba(255, 255, 255, 0.38); }
.legends-time { color: rgba(255, 255, 255, 0.4); }

/* top three ranks wear medal colors and grow a step */
.legends-list li:nth-child(1) .legends-rank,
.legends-list li:nth-child(2) .legends-rank,
.legends-list li:nth-child(3) .legends-rank { font-size: 1.12em; }
.legends-list li:nth-child(1) .legends-rank { color: #ffd23f; text-shadow: 0 0 10px rgba(255, 210, 63, 0.4); }
.legends-list li:nth-child(2) .legends-rank { color: #e8e8f2; text-shadow: 0 0 8px rgba(232, 232, 242, 0.3); }
.legends-list li:nth-child(3) .legends-rank { color: #d9905f; text-shadow: 0 0 8px rgba(217, 144, 95, 0.3); }

/* score readout: tiny caps label above a yellow tabular value */
.legends-score { color: var(--party-yellow); font-variant-numeric: tabular-nums; }
.legends-score::before {
  content: "PTS"; display: block;
  font-size: 0.55rem; font-weight: 600; letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.38);
}

/* empty state: pixel-flavoured coin prompt, blinking */
.legends-list li.legends-empty {
  display: block; text-align: center; padding: 20px 8px 16px;
  color: rgba(255, 255, 255, 0.5);
}
.legends-empty::before {
  content: "▸ INSERT COIN ◂"; display: block;
  font-style: normal; font-family: var(--display); font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.34em; text-indent: 0.34em;
  color: var(--party-yellow);
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.45);
  margin-bottom: 8px;
  animation: insert-coin 1.1s steps(2, start) infinite;
}
@keyframes insert-coin { 50% { opacity: 0.3; } }

/* "You rank #N" as a yellow highlight chip */
.legends-you {
  display: inline-block;
  background: var(--party-yellow); color: var(--party-ink);
  border: 2.5px solid var(--party-ink); border-radius: 999px;
  padding: 4px 14px;
  font-family: var(--display); font-weight: 600; font-size: 0.85rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(-0.8deg);
}

/* newly arrived rows bounce in once instead of the old flash */
.legends-list li.legends-new {
  border-radius: 10px;
  background: rgba(255, 210, 63, 0.14);
  animation: legends-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1;
}
@keyframes legends-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- end screen: arcade results ---------- */
.game-panel .end-score {
  color: var(--party-yellow);
  text-shadow: 0 0 22px rgba(255, 210, 63, 0.32), 3px 3px 0 rgba(0, 0, 0, 0.5);
}
.game-panel .end-score span { color: rgba(255, 255, 255, 0.45); text-shadow: none; }

/* tilted banner party.js drops in when the local best falls */
.party-newbest {
  display: inline-block; margin: 0 auto 14px;
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.06em;
  background: var(--party-yellow); color: var(--party-ink);
  border: 3px solid var(--party-ink); border-radius: 12px;
  padding: 8px 20px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 210, 63, 0.35);
  transform: rotate(-2deg);
  animation: newbest-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}
@keyframes newbest-pop {
  0% { transform: rotate(-2deg) scale(0.4); opacity: 0; }
  60% { transform: rotate(-2deg) scale(1.12); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); opacity: 1; }
}

/* share row + Play Again rebalanced for the dark panel; 3D press craft kept */
.game-panel .end-screen .btn { box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5); }
.game-panel .end-screen .btn:hover { box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5); }
.game-panel .end-screen .btn:active { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.game-panel .end-screen #copy-result {
  background: var(--party-yellow); color: var(--party-ink); text-shadow: none;
}
.game-panel .end-screen .btn-secondary {
  background: rgba(255, 255, 255, 0.08); color: #ffffff;
  border-color: rgba(255, 255, 255, 0.32);
  text-shadow: none;
}

/* unlit stars must read as empty sockets on the dark screen */
.game-panel .party-stars span {
  color: rgba(255, 255, 255, 0.13);
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.3);
}

/* streak / nickname / brain-chart lines on dark */
.game-panel .daily-streak-line { color: #ffb35c; }
.game-panel .lb-name-hint { color: #6ee7a8; }
.game-panel .brain-title { color: #ffffff; }
.game-panel .brain-label { color: rgba(255, 255, 255, 0.72); }
.game-panel .brain-pct { color: var(--party-yellow); }
.game-panel .brain-bar {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.16);
}

/* facts.js keeps its light sticker cards inside the dark panel */
.game-panel .facts-more {
  border-color: rgba(46, 16, 101, 0.55);
  background: rgba(255, 255, 255, 0.82);
}

/* ---------- daily card: photo poster ---------- */
.daily-card {
  background: linear-gradient(180deg, #1d0d40, #14092e 62%);
  background-size: cover; background-position: center 30%;
}
/* scrim fades in only when the poster photo actually loaded (daily.js) */
.daily-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: 15px;
  background: linear-gradient(180deg,
    rgba(10, 4, 26, 0.18) 0%, rgba(10, 4, 26, 0.55) 52%, rgba(10, 4, 26, 0.9) 100%);
  opacity: 0; transition: opacity 0.2s ease;
}
.daily-card.has-photo::before { opacity: 1; }
.daily-card > * { position: relative; z-index: 1; }

.daily-title { color: #ffffff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.daily-theme { color: #ffffff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.daily-sub { color: rgba(255, 255, 255, 0.68); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55); }

/* streak + today's best as small yellow capsules */
.daily-you, .daily-card-streak {
  display: inline-block;
  background: var(--party-yellow); color: var(--party-ink);
  border: 2px solid var(--party-ink); border-radius: 999px;
  padding: 2px 12px; font-size: 0.82rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.daily-card-streak { margin-top: 8px; }

/* mini board rows in white */
.daily-board { border-top-color: rgba(255, 255, 255, 0.22); }
.daily-board li { color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.daily-rank { background: var(--party-yellow); color: var(--party-ink); }
.daily-board-empty { color: rgba(255, 255, 255, 0.55); }

/* ---------- footer: oversized clipped wordmark ---------- */
.site-footer { overflow: hidden; }
.footer-inner::before {
  content: "NAME 100 CHALLENGE"; display: block;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.92; letter-spacing: -0.01em; white-space: nowrap;
  color: rgba(255, 255, 255, 0.06);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  margin: 4px 0 6px -6px;
  user-select: none;
}
.footer-series a, .footer-nav a { font-size: 13px; }
.footer-series-label { color: var(--party-yellow); }
.footer-copy { color: rgba(255, 255, 255, 0.45); }

/* ---------- content pages: cabinet-manual paper panels ---------- */
/* Scoped to main.page so the homepage and play pages are untouched. */
main.page .prose {
  background: #f8f6f1;
  border: 2.5px solid var(--party-ink); border-radius: 16px;
  box-shadow: 7px 7px 0 rgba(20, 7, 45, 0.42);
  padding: 8px 22px; margin-bottom: 22px;
}
main.page .prose p { color: #453f63; }
main.page .prose strong { color: var(--party-ink); }
main.page .prose a { color: #b0145a; }

main.page .rules-list {
  background: #f8f6f1;
  border: 2.5px solid var(--party-ink); border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(20, 7, 45, 0.4);
  padding: 10px 26px;
}
main.page .rules-list li { color: #453f63; }
main.page .rules-list strong { color: var(--party-ink); }

main.page details.faq {
  background: #f8f6f1;
  border: 2.5px solid var(--party-ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(20, 7, 45, 0.38);
  padding: 4px 20px;
}
main.page details.faq[open] { box-shadow: 5px 5px 0 var(--party-pink); }
main.page details.faq summary { color: var(--party-ink); font-family: var(--display); font-weight: 600; }
main.page details.faq summary::after { color: var(--party-pink); }
main.page details.faq p { color: #5b5479; }

/* headings stay on the purple field with a restrained glow */
main.page > h1 {
  text-shadow: 2px 2px 0 rgba(30, 12, 64, 0.5), 0 0 22px rgba(255, 255, 255, 0.14);
}

/* loose paragraphs between panels (picture-quiz link, rules shortcut) */
main.page > p, main.page section > p { color: rgba(255, 255, 255, 0.85); }
main.page > p a, main.page section > p a { color: #9df0ff; }

/* tighter paper padding on phones */
@media (max-width: 560px) {
  main.page .prose { padding: 6px 16px; }
  main.page .rules-list { padding: 8px 18px; }
  main.page details.faq { padding: 4px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .legends-list li.legends-new, .legends-empty::before, .party-newbest { animation: none; }
}

/* round 5 fix: the bobbing #party-emoji badge is a full-width block, so its
   rotation poked ~1-2px past the viewport at 390px. Shrink-wrap the badge so
   the rotation only ever swings the icon itself; visually identical. */
#party-emoji { width: fit-content; margin-left: auto; margin-right: auto; }

/* ============ answer UX: numbered tiles, latest pulse, pace line ============
   Behaviors live in party.js (round 6 block). All additive. */

/* number badge inside each answer sticker: newest tile shows the running total */
.entry-num {
  display: inline-block; min-width: 1.5em; text-align: center;
  margin-right: 6px; padding: 0 4px;
  font-family: var(--display); font-weight: 700; font-size: 0.72rem; line-height: 1.6;
  color: var(--party-ink); background: rgba(30, 12, 64, 0.14);
  border-radius: 999px; vertical-align: 1px;
}

/* latest answer: stronger pop + yellow highlight ring, settles in 0.6s */
.entries li.entry-new {
  position: relative; z-index: 1;
  animation: entry-pulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes entry-pulse {
  0%   { transform: scale(0.55); box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9), 2.5px 2.5px 0 rgba(30, 12, 64, 0.4); }
  45%  { transform: scale(1.14); box-shadow: 0 0 0 7px rgba(255, 210, 63, 0.85), 2.5px 2.5px 0 rgba(30, 12, 64, 0.4); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255, 210, 63, 0),    2.5px 2.5px 0 rgba(30, 12, 64, 0.4); }
}

/* pace estimate: small readout right under the progress bar */
.pace-line {
  margin: 6px 4px 0; text-align: right;
  font-family: var(--display); font-weight: 500; font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.pace-line[hidden] { display: none; }

/* typing feel: the pill input grows a whisper while focused */
.entry-form input { transition: transform 0.14s ease; }
.entry-form input:focus { transform: scale(1.01); }

@media (prefers-reduced-motion: reduce) {
  .entries li.entry-new { animation: none; }
  .entry-form input { transition: none; }
  .entry-form input:focus { transform: none; }
}

/* keep the focused input inside the panel on narrow phones */
@media (max-width: 480px) {
  .entry-form input:focus { transform: none; }
}

/* ============ round 6: homepage directory poster cards ============
   The .cards directory below the poster-wall picker becomes a grid of poster
   link cards: theme photo cropped 4:3, title + one-liner on a gradient scrim.
   Link semantics unchanged; the round 2/4 lift + alternating tilt still apply. */

.cards > .card {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.card-img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.25s ease;
}
/* scrim keeps the text readable over any poster art */
.cards > .card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10, 4, 26, 0.04) 0%, rgba(10, 4, 26, 0.42) 52%, rgba(10, 4, 26, 0.88) 100%);
}
.cards > .card > h2, .cards > .card > p { position: relative; z-index: 2; }
.cards > .card h2 {
  margin: 0 0 4px; color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.cards > .card p {
  color: rgba(255, 255, 255, 0.85); font-size: 0.85rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  /* clamp the one-liner so every poster keeps its 4:3 crop */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* the old color chip duplicates the poster art — hide it */
.cards > .card .tag { display: none; }
/* hover: the card lift/straighten comes from the round 2/4 rules; the poster breathes */
.cards > .card:hover .card-img { transform: scale(1.05); }
.cards > .card:focus-visible { outline: 3px solid var(--party-yellow); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .card-img { transition: none; }
  .cards > .card:hover .card-img { transform: none; }
}

/* ============ round 7: dual-mode discoverability ============ */

/* per-card dual entry pills (Type / Photo) — always visible */
.chip-modes {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3;
  display: flex; gap: 6px;
}
.chip-mode {
  flex: 1; text-align: center; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 0.78rem;
  color: #fff; background: rgba(20, 9, 46, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.45); border-radius: 999px;
  padding: 5px 0 4px; backdrop-filter: blur(2px);
  transition: background 0.12s ease, transform 0.12s ease;
}
.chip-mode:hover, .chip-mode:focus-visible {
  background: var(--party-yellow); color: var(--party-ink);
  border-color: var(--party-ink); transform: scale(1.06);
}
/* keep the name clear of the pills */
.chip:has(.chip-modes) .chip-name { bottom: 40px; }
.chip:has(.chip-modes) .chip-cta { bottom: 40px; }

/* in-game mode bar: loud pills overlapping the panel top, smaller than the
   round-7 pair and horizontally scrollable now that six modes share the row */
.mode-toggle {
  display: flex; gap: 8px; justify-content: center;
  position: relative; z-index: 2; margin: 4px 0 -22px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 4px 8px; /* keeps the pill shadows visible while scrolling */
}
.mode-toggle[hidden] { display: none; }
.mode-toggle button {
  font-family: var(--display); font-weight: 700; font-size: 0.85rem;
  border: 3px solid var(--party-ink); border-radius: 14px; background: #fff;
  color: var(--party-ink); padding: 6px 14px 5px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(30, 12, 64, 0.5); line-height: 1.15;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  flex: 0 0 auto; white-space: nowrap;
}
.mode-toggle button small {
  display: block; font-size: 0.62rem; font-weight: 500;
  color: var(--muted); letter-spacing: 0.4px;
}
.mode-toggle button.on small { color: rgba(46, 16, 101, 0.75); }
.mode-toggle button.on {
  background: var(--party-yellow); transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(30, 12, 64, 0.55);
}
/* narrow screens: scroll from the first pill instead of clipping both ends */
@media (max-width: 640px) {
  .mode-toggle { justify-content: flex-start; }
}
/* one-time attention pulse on the Picture tab until first used */
.mode-toggle.attention button[data-mode="picture"] {
  animation: mode-pulse 1.4s ease-in-out 3;
}
@keyframes mode-pulse {
  50% { transform: scale(1.07); box-shadow: 0 0 0 7px rgba(255, 210, 63, 0.45); }
}
/* panel needs room under the overlapping toggle */
.mode-toggle:not([hidden]) + .game-panel { padding-top: 40px; }

/* chain mode: required next start letter, injected under the input row */
.chain-letter {
  margin: 6px 2px 0; font-family: var(--display); font-weight: 700;
  font-size: 0.85rem; color: var(--muted);
}
.chain-letter.on { color: var(--party-ink); }

/* content-page picture quiz link → banner button */
.pic-quiz-link {
  text-align: center;
}
.pic-quiz-link a {
  display: inline-block; text-decoration: none;
  font-family: var(--display); font-weight: 700;
  background: var(--party-yellow); color: var(--party-ink);
  border: 3px solid var(--party-ink); border-radius: 999px;
  padding: 10px 22px; box-shadow: 0 4px 0 rgba(30, 12, 64, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pic-quiz-link a:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 7px 0 rgba(30, 12, 64, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .mode-toggle.attention button[data-mode="picture"] { animation: none; }
  .chip-mode, .pic-quiz-link a { transition: none; }
}

/* hidden attribute must always win over display:flex/grid rules */
#entries[hidden], .guess-stage[hidden], .giveup-row [hidden] { display: none !important; }
