/* Rare Find (v9.0): builds on /style.css (tokens, .card, .btn, .input, .seg, .logo). Normal page
   scrolling (the home-screen scroll lock belongs to the drawing game page only). */
.rare-page { min-height: 100%; height: auto; }
.rare-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.rare-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rare-logo { font-size: clamp(34px, 7vw, 52px); text-decoration: none; }
.rare-top-right { display: flex; gap: 8px; align-items: center; }
.rare-lang { display: flex; padding: 4px; gap: 2px; background: rgba(255,255,255,.9); border-radius: 999px; box-shadow: var(--shadow); }
.rare-lang button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font: 800 13px 'Nunito', sans-serif; color: var(--muted); cursor: pointer; }
.rare-lang button.on { background: var(--brand); color: #fff; }
.rare-view { display: flex; flex-direction: column; gap: 16px; align-items: center; animation: rIn .3s ease both; }
.rare-tagline { color: #f1edff; font-weight: 800; font-size: clamp(16px, 2.6vw, 20px); text-align: center; margin: 0; }
.rare-card { width: 100%; max-width: 460px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.rare-how { width: 100%; max-width: 460px; padding: 18px 22px; }
.rare-how h2 { font-size: 22px; margin-bottom: 6px; }
.rare-how ol { margin: 0 0 12px; padding-left: 20px; color: #514b69; line-height: 1.55; }
.rare-foot { color: #fff; margin: 0; }
.tier-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.tier { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 800 12px 'Nunito', sans-serif; background: var(--soft); color: var(--muted); }
.tier.c { background: #eef0f6; color: #55607a; }
.tier.u { background: #e3f0ff; color: #1d5fb8; }
.tier.r { background: #fff1d6; color: #9a5b00; }
.tier.uq { background: #f3e8ff; color: #6b2fb3; }
.tier.sh { background: #fde4ea; color: #a8203f; }

/* lobby */
.rare-lobby { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.rare-lobby .rare-card { max-width: none; }
.rare-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rare-players li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--soft); }
.rare-players li.away { opacity: .55; }
.rare-players .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: hsl(var(--h), 70%, 55%); flex-shrink: 0; }
.rare-players .pname { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rare-players .tag { margin-left: 6px; font-size: 11px; font-weight: 800; color: var(--muted); }
.rare-players .tag.me { color: var(--bg1); }
.rare-players .ok { color: var(--good); font-weight: 800; }
.rare-players .pscore { font: 800 18px 'Baloo 2', sans-serif; }
.rare-players .kick { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: 800 14px 'Nunito', sans-serif; color: var(--muted); cursor: pointer; }
.cat-chip.on { border-color: var(--bg1); background: var(--soft); color: var(--ink); }
.cat-chip:disabled { cursor: default; }

/* game */
.rare-game { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.rare-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q-round, .q-cat, .q-double { padding: 5px 12px; border-radius: 999px; font: 800 13px 'Nunito', sans-serif; background: rgba(255,255,255,.92); color: var(--ink); }
.q-double { background: var(--accent); color: #3a2a00; }
.q-card { padding: clamp(18px, 4vw, 32px); display: flex; flex-direction: column; gap: 14px; position: relative; }
.q-countdown { font: 800 15px 'Nunito', sans-serif; color: var(--bg1); }
.q-text { font-size: clamp(26px, 4.6vw, 42px); line-height: 1.15; color: var(--ink); transition: filter .3s, opacity .3s; overflow-wrap: anywhere; }
.q-text.blur { filter: blur(6px); opacity: .5; }
.q-timer, .next-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.q-timer i, .next-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bg2), var(--bg1)); transform-origin: left; transition: transform .25s linear; }
.q-timer i.urgent { background: linear-gradient(90deg, #ff9a3c, var(--brand)); }
.next-bar { height: 6px; }
.answer-row { display: flex; gap: 8px; }
.big-input { font-size: 20px; font-weight: 800; padding: 14px 16px; }
.answer-note { margin: 0; color: var(--muted); font-weight: 700; min-height: 1.2em; }
.reveal { display: flex; flex-direction: column; gap: 10px; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.res { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) auto auto; gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--soft); border: 2px solid transparent; }
.res.me { border-color: var(--bg1); }
.res.rare { background: #fff6e2; }
.res.zero { opacity: .7; }
.res-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-ans { font-weight: 700; overflow-wrap: anywhere; }
.res-ans small { color: var(--muted); font-weight: 700; }
.res-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.res-pts { font: 800 22px 'Baloo 2', sans-serif; color: var(--bg1); min-width: 44px; text-align: right; }
.reveal.animate .res { animation: resIn .45s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i) * 140ms); }
.missed { margin: 0; color: #9a5b00; font-weight: 700; font-size: 14px; }
.rare-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 12px; }
.rare-chat { display: flex; flex-direction: column; gap: 6px; }
.chat-log { height: 200px; overflow-y: auto; font-size: 14px; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; }
.cl.sys { color: var(--muted); font-style: italic; }
.chat-row { display: flex; gap: 6px; }

/* end */
.end-card { max-width: 560px; align-items: center; text-align: center; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; width: 100%; margin-top: 6px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 30%; min-width: 0; animation: podUp .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.pod b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pod span:not(.pod-medal) { color: var(--muted); font-weight: 800; font-size: 13px; }
.pod-medal { font-size: 30px; }
.pod i { display: block; width: 100%; border-radius: 12px 12px 0 0; background: hsl(var(--h), 70%, 60%); margin-top: 6px; }
.pod.p1 i { height: 110px; } .pod.p2 i { height: 80px; } .pod.p3 i { height: 60px; }
.pod.p1 { animation-delay: .3s; } .pod.p2 { animation-delay: .15s; }
.final-list { list-style: decimal; text-align: left; width: 100%; margin: 0; padding-left: 28px; }
.final-list li span { font-weight: 800; } .final-list li b { float: right; }
.awards-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.award { background: var(--soft); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; font-size: 13px; }
.end-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* little celebrations */
.rare-fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.rare-fx span { position: absolute; top: -40px; left: var(--x); font-size: 28px; animation: fall 1.8s ease-in forwards; animation-delay: var(--d); transform: rotate(var(--r)); }
@keyframes fall { to { transform: translateY(110vh) rotate(calc(var(--r) * 4)); opacity: .6; } }
@keyframes resIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes podUp { from { opacity: 0; transform: translateY(30px); } }
@keyframes rIn { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 820px) {
  .rare-game { grid-template-columns: 1fr; }
  .rare-side { position: static; }
  .chat-log { height: 140px; }
}
@media (max-width: 520px) {
  .rare-shell { width: calc(100% - 24px); }
  .res { grid-template-columns: minmax(0, 1fr) auto; }
  .res-ans { grid-column: 1 / -1; grid-row: 2; }
  .res-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .answer-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .rare-view, .reveal.animate .res, .pod { animation: none; }
  .q-text, .q-timer i, .next-bar i { transition: none; }
}
