/* Crowd Favourite and the mode switch (Main Stage or Crowd Favourite). body[data-mode] says which is on.
   Same surfaces as the rest of the site: paper cards, solid tiles, label-maker strips, red buttons with a ledge. */

/* ---------- What each mode shows ---------- */
.for-crowd, .crowd-list, #crowd-game, .wall-crowd { display: none; }
body[data-mode="crowd"] .for-main { display: none !important; }
body[data-mode="crowd"] .for-crowd { display: inline; }
body[data-mode="crowd"] #main-content, body[data-mode="crowd"] .key-hint, body[data-mode="crowd"] #show-submission-form-btn,
body[data-mode="crowd"] #panel-latest > .panel-head, body[data-mode="crowd"] #latest-grid,
body[data-mode="crowd"] #panel-boards > .panel-head, body[data-mode="crowd"] #panel-boards > .seg,
body[data-mode="crowd"] #leaderboard-list-best, body[data-mode="crowd"] #leaderboard-list-worst,
body[data-mode="crowd"] #dock-submit, body[data-mode="crowd"] .live-toast, body[data-mode="crowd"] .live-badge { display: none !important; }
body[data-mode="crowd"] #crowd-game { display: block; }
body[data-mode="crowd"] .crowd-list { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
body[data-mode="crowd"] .dock { grid-template-columns: repeat(3, 1fr) !important; }
.dock { grid-template-columns: repeat(4, 1fr) !important; }
.dock button.play svg { color: #ffcf33; }

/* Crowd Favourite gets its own wall: the same photo, greyer, under a deep red light */
.wall-crowd { display: block; opacity: 0; transition: opacity 700ms ease; filter: grayscale(1) contrast(1.15) brightness(.85); }
.wall-crowd::after { background: radial-gradient(ellipse at 50% 30%, rgba(120,8,18,.55), rgba(20,0,2,.88) 70%) !important; }
body[data-mode="crowd"] .wall-crowd { opacity: 1; }
@media (min-width: 1280px) { body[data-mode="crowd"] .panel { background: #120a0b; } }

/* ---------- Menu rows: the phone menu and the Play drawer ---------- */
.m-menu h4 { margin: 16px 0 6px; font: 700 11.5px 'Courier Prime', monospace; letter-spacing: .1em; text-transform: uppercase; color: #8f8f8a; }
.m-menu h4:first-child { margin-top: 0; }
.m-list { display: grid; gap: 6px; }
.m-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; width: 100%; height: 54px; padding: 0 12px 0 6px; border-radius: 10px;
         border: 1px solid transparent; background: transparent; color: var(--ink); font: 700 15.5px 'Rubik', sans-serif; text-align: left; cursor: pointer; }
.m-row:hover { background: #1d1d1d; border-color: #2c2c2c; }
.m-row .m-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #0f0f0f; border: 1px solid #2e2e2e; }
.m-row .m-ic svg { width: 25px; height: 25px; }
.m-row.current { background: #1d1d1d; border-color: #3a3a3a; }
.m-row.current .m-ic { background: var(--red); border-color: var(--red); color: #fff; }
.m-row.soon { opacity: .42; cursor: default; }
.m-row.soon:hover { background: transparent; border-color: transparent; }
.m-tag { font: 700 10px 'Courier Prime', monospace; letter-spacing: .08em; text-transform: uppercase; color: #bdbdb8; border: 1px solid #555; padding: 2px 6px; border-radius: 3px; }
.m-tag.new { color: #111; background: #ffcf33; border-color: #ffcf33; }
.m-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; margin-top: 18px; font-size: 16px; }
.m-submit svg { width: 20px; height: 20px; }
#panel-play .m-row { height: 60px; font-size: 17px; }
@media (min-width: 1280px) { #panel-play { display: none !important; } }

/* ---------- Desktop: the game mode dropdown, top left ---------- */
.mode-pick { display: none; }
@media (min-width: 1280px) {
    .mode-pick { display: block; position: relative; flex: none; margin-bottom: 14px; }
    .mode-btn { display: flex; align-items: center; gap: 12px; width: 100%; height: 60px; padding: 0 14px 0 8px; font: 800 18px 'Rubik', sans-serif; text-align: left; }
    .mode-btn .m-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--red); color: #fff; }
    .mode-btn .m-ic svg { width: 28px; height: 28px; }
    .mode-btn .chev { margin-left: auto; width: 18px; height: 18px; color: #bdbdb8; transition: transform 160ms; }
    .mode-pick.open .chev { transform: rotate(180deg); }
    .mode-menu { position: absolute; z-index: 30; left: 0; right: 0; top: 66px; padding: 6px; border-radius: 12px; background: #1a1a1a; border: 1px solid #333;
                 box-shadow: 0 3px 0 #000, 0 18px 40px rgba(0,0,0,.7); display: none; }
    .mode-pick.open .mode-menu { display: grid; gap: 4px; }
}

/* ---------- Crowd Favourite lists (side panels on desktop, drawers on phones) ---------- */
.crowd-list .list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crowd-list .item { cursor: default; }
.crowd-list .pts.win { background: #2a2410; color: #ffcf33; }
.crowd-empty { color: var(--muted); font-size: 14px; line-height: 1.5; padding: 6px 2px; }
@media (min-width: 1280px) { .crowd-list .list { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; padding: 2px 4px 8px; margin: 0 -4px; scrollbar-width: none; } }

/* ---------- The game ---------- */
#crowd-game { width: 100%; max-width: 768px; }
@media (max-width: 1279px) { body[data-mode="crowd"] .center { justify-content: flex-start; padding-top: 8px; } }
.cf-head { display: flex; flex-direction: column; align-items: center; margin: 4px 0 24px; }
.cf-new { margin-bottom: 8px; font: 800 12px 'Rubik', sans-serif; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 3px;
          background: #ffcf33; color: #111; transform: rotate(-3deg); box-shadow: 0 2px 0 rgba(0,0,0,.45); }
.cf-title { font: 700 22px/1.15 'Courier Prime', monospace; letter-spacing: .12em; text-transform: uppercase; padding: 10px 22px 9px; border-radius: 3px;
            background: #0e0e0e; color: #f6f6f2; transform: rotate(-2deg); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 0 rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.6); }
@media (min-width: 1280px) { .cf-head { margin: -10px 0 20px; } .cf-title { font-size: 30px; padding: 12px 30px 11px; } .cf-new { font-size: 13px; } }
.cf-q { margin: 0 0 14px; text-align: center; color: #ececE7; font: 700 16px 'Rubik', sans-serif; text-shadow: 0 1px 2px #000, 0 0 10px #000, 0 0 18px rgba(0,0,0,.9); }

.duel { display: grid; gap: 10px; }
.duel .vs { justify-self: center; align-self: center; margin: -18px 0; position: relative; z-index: 3; transform: rotate(-6deg); font: 700 15px/1 'Courier Prime', monospace; letter-spacing: .14em;
            text-transform: uppercase; padding: 7px 12px 6px; border-radius: 3px; background: #0e0e0e; color: #f6f6f2;
            box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 0 rgba(0,0,0,.6), 0 3px 8px rgba(0,0,0,.6); }
.pickc { position: relative; overflow: hidden; min-height: 138px; padding: 22px 22px 36px; display: grid; place-items: center; width: 100%; border: 0; cursor: pointer; font: inherit; text-align: center;
         background: var(--paper); color: var(--paper-ink); border-radius: 3px; box-shadow: inset 0 0 22px rgba(90,65,30,.14), 0 2px 0 rgba(0,0,0,.35), 0 18px 30px -14px rgba(0,0,0,.85);
         transition: transform 160ms ease-out, filter 300ms; }
.pickc:hover { transform: translateY(-2px); }
.pickc .nm { position: relative; z-index: 2; margin: 0; font: 800 22px/1.2 'Rubik', sans-serif; text-wrap: balance; overflow-wrap: anywhere; }
@media (min-width: 768px) { .pickc .nm { font-size: 27px; } }
.duel.done .pickc { cursor: default; transform: none; }
.duel.done .pickc:not(.chosen) { filter: saturate(.5) brightness(.8); }
.pickc .imprint { position: absolute; z-index: 1; top: 10px; right: 12px; width: 78px; height: 78px; opacity: 0; pointer-events: none; mix-blend-mode: multiply; transform: rotate(var(--r, -12deg)); }
.pickc .imprint svg { width: 100%; height: 100%; }
.pickc.chosen .imprint { animation: cf-stamp 260ms cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes cf-stamp { 0% { opacity: 0; transform: rotate(var(--r)) scale(1.7); } 60% { opacity: 1; } 100% { opacity: .92; transform: rotate(var(--r)) scale(1); } }
@media (max-width: 767px) { .pickc .imprint { width: 54px; height: 54px; top: 6px; right: 6px; } }
@media (min-width: 1280px) {
    .duel { grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 0 14px; }
    .duel .vs { margin: 0 -24px; }
    .pickc { min-height: 250px; }
}
.reveal { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 10px; display: flex; align-items: center; gap: 10px; font: 700 13px 'Rubik', sans-serif; color: #5a564d; }
.reveal .rate { white-space: nowrap; }
.reveal .rate b { color: #141414; font-size: 15px; }
.reveal i { flex: 1; height: 6px; border-radius: 3px; background: #ddd8ca; overflow: hidden; }
.reveal i::after { content: ""; display: block; height: 100%; width: var(--w); background: #b3121a; animation: cf-grow 700ms ease-out; }
@keyframes cf-grow { from { width: 0; } }
.reveal .first-fan { margin: 0 auto; font: 700 20px/1 'Courier Prime', monospace; letter-spacing: .14em; text-transform: uppercase; background: #b3121a; color: #fff; padding: 8px 16px 7px; border-radius: 3px;
                     transform: rotate(-3deg); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 6px rgba(0,0,0,.4); animation: cf-fan 320ms cubic-bezier(.3,1.6,.5,1); }
@keyframes cf-fan { from { transform: rotate(-3deg) scale(1.6); opacity: 0; } }
.reveal .quiet { margin: 0 auto; font: 700 11.5px 'Courier Prime', monospace; letter-spacing: .1em; text-transform: uppercase; color: #6d6a62; }
@media (min-width: 1280px) { .reveal .first-fan { font-size: 24px; } }

.cf-next { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cf-go { flex: none; height: 52px; padding: 0 26px; font: 900 17px 'Rubik', sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.cf-go:disabled { opacity: .35; cursor: default; }
.cf-timer { display: block; height: 4px; margin-top: 10px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.cf-timer i { display: block; height: 100%; width: 0; background: #ff4a50; }
.cf-timer.run i { width: 100%; transition: width 4000ms linear; }

/* Your picks: a flame that levels up at 5, 10, 20, 50, 100, 250, and 500 */
.streak { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: #141414; border: 1px solid #2c2c2c; box-shadow: 0 2px 0 #000; }
.streak .flame { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.streak .flame svg { width: 100%; height: 100%; fill: none; stroke: #8f8f8a; stroke-width: 2; }
.streak .n { font: 900 20px 'Rubik', sans-serif; color: #f2f2f2; min-width: 1ch; }
.streak em { font: 700 10.5px 'Courier Prime', monospace; letter-spacing: .08em; text-transform: uppercase; font-style: normal; padding: 3px 7px; border-radius: 3px; background: var(--paper); color: #111; transform: rotate(-3deg); }
.streak .sk { position: absolute; left: 50%; top: 58%; width: 11px; height: 14px; transform: translate(-50%, -50%); background: #fff; -webkit-mask: url(/skull-ink.png) center / contain no-repeat; mask: url(/skull-ink.png) center / contain no-repeat; }
.streak .spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffcf33; opacity: 0; }
.streak .s1 { left: 2px; top: 2px; animation: cf-spark 1.4s ease-out infinite; }
.streak .s2 { right: 0; top: 6px; animation: cf-spark 1.4s ease-out .7s infinite; }
@keyframes cf-spark { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes cf-flicker { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.08, 1.12) rotate(-3deg); } }
.t-warm .flame svg { fill: #ff9a3c; stroke: #ff9a3c; }
.t-support .flame svg { fill: #ff6a2b; stroke: #ff6a2b; filter: drop-shadow(0 0 4px rgba(255,106,43,.7)); }
.t-support .flame { animation: cf-flicker 1.2s ease-in-out infinite; }
.t-fire .flame svg { fill: #ff3b2b; stroke: #ffcf33; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(255,80,40,.9)); }
.t-fire .flame { animation: cf-flicker .9s ease-in-out infinite; }
.t-fire, .t-headliner { border-color: #5a1a12; }
.t-headliner .flame { width: 32px; height: 32px; animation: cf-flicker .9s ease-in-out infinite; }
.t-headliner .flame svg { fill: #d0161c; stroke: #ff9a3c; stroke-width: 1.5; filter: drop-shadow(0 0 8px rgba(208,22,28,.9)); }
.t-legend .flame, .t-hall .flame, .t-immortal .flame { width: 34px; height: 34px; animation: cf-flicker 1.1s ease-in-out infinite; }
.t-legend .flame svg, .t-hall .flame svg, .t-immortal .flame svg { fill: #ffcf33; stroke: #fff2b0; stroke-width: 1.2; filter: drop-shadow(0 0 10px rgba(255,207,51,.9)); }
.t-legend .sk, .t-hall .sk, .t-immortal .sk { background: #3a2a00; }
.t-legend, .t-hall, .t-immortal { border-color: #6b5410; box-shadow: 0 2px 0 #000, 0 0 18px rgba(255,207,51,.25); }
.t-legend em, .t-hall em, .t-immortal em { background: #ffcf33; }
.t-immortal { background: linear-gradient(90deg, #1d1606, #141414); }
.streak.level-up { animation: cf-level 600ms cubic-bezier(.3,1.6,.5,1); }
@keyframes cf-level { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-3deg); } 100% { transform: scale(1); } }

/* ---------- Tutorial: the page goes dark except one thing ---------- */
.cf-spot { position: fixed; z-index: 2147483000; pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 200vmax rgba(6,6,6,0); outline: 2px solid transparent; outline-offset: 2px;
           transition: all 380ms cubic-bezier(.22,.61,.36,1); }
.cf-spot.on { box-shadow: 0 0 0 200vmax rgba(6,6,6,.8); outline-color: rgba(255,255,255,.85); }
.cf-note { position: fixed; z-index: 2147483002; box-sizing: border-box; padding: 13px 14px 12px; border-radius: 12px; background: #1d1d1d; border: 1px solid #333; color: #f2f2f2;
           font: 400 15px/1.45 'Rubik', sans-serif; text-align: left; box-shadow: 0 3px 0 #000, 0 18px 40px rgba(0,0,0,.7); opacity: 0; transition: opacity 260ms; }
.cf-note.on { opacity: 1; }
.cf-note p { margin: 8px 0 4px; }
.cf-nhead { display: flex; justify-content: space-between; align-items: center; }
.cf-tag { display: inline-block; font: 700 12px/1.2 'Courier Prime', monospace; letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; border-radius: 3px; background: var(--paper); color: #141414; transform: rotate(-2deg); }
.cf-acts { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 4px; }
.cf-skip { background: none; border: 0; padding: 6px 2px; color: var(--muted); font: 600 14px 'Rubik', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cf-step { height: 38px; padding: 0 18px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
    .pickc.chosen .imprint, .streak .flame, .streak .spark, .streak.level-up, .reveal .first-fan { animation: none !important; }
    .pickc.chosen .imprint { opacity: .92; }
    .wall-crowd, .cf-spot { transition: none; }
}
.crowd-rows { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
