/* Porkies styles. Tabloid red-top meets pub quiz. */
#porkies { background: radial-gradient(120% 70% at 50% 0%, #4a1452 0%, #2a0d30 55%, #170719 100%); }
#porkiesRoot { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
#porkiesRoot .pk-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 10px; overflow: hidden; }
#porkiesRoot .pk-ctl { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 14px; overflow-y: auto; }
#porkiesRoot.pk-both .pk-stage { flex: 0 0 auto; max-height: 46%; border-bottom: 2px dashed rgba(255,255,255,.14); }
#porkiesRoot.pk-both .pk-stage .pk-q { font-size: 16px; padding: 10px 12px; }
#porkiesRoot.pk-both .pk-stage .pk-opt { padding: 6px 8px; font-size: 14px; }
#porkiesRoot.pk-both .pk-stage .pk-w .avatar { width: 30px; height: 30px; font-size: 12px; }
#porkiesRoot.pk-both .pk-stage .pk-who { gap: 6px; }
#porkiesRoot.pk-both .pk-stage .pk-stage-note { display: none; }
#porkiesRoot.pk-both .pk-stage .pk-bar { display: none; }
#porkiesRoot.pk-both .pk-ctl .pk-ctl-q { display: none; }
.pk-telly-note { text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--ink-dim); padding: 6px 0 0; }

/* ----- stage ----- */
.pk-qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-qno { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--brass); line-height: 1; }
.pk-qno small { font-size: 16px; color: var(--ink-dim); margin-left: 2px; }
.pk-qhead.small .pk-qno { font-size: 22px; }
.pk-double { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .12em; padding: 5px 10px; border-radius: 8px; background: #ff3d8a; color: #fff; transform: rotate(-3deg); box-shadow: 3px 3px 0 #1d1a14; animation: pk-pulse 1s ease-in-out infinite alternate; }
@keyframes pk-pulse { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(-3deg) scale(1.08); } }
.pk-q { background: #fbf3dd; color: #1d1a14; border-radius: 16px; padding: 16px 16px; font-family: var(--display); font-weight: 700; font-size: 23px; line-height: 1.22; box-shadow: 0 10px 0 #b8902e, 0 18px 30px rgba(0,0,0,.35); text-wrap: balance; transform: rotate(-.6deg); }
.pk-q.long { font-size: 18px; }
.pk-q.dbl { background: #ffe1ec; box-shadow: 0 10px 0 #c22b66, 0 18px 30px rgba(0,0,0,.35); }
.pk-stage-note { text-align: center; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--ink-dim); }
.pk-bar { position: relative; height: 18px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; flex: 0 0 auto; }
.pk-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #2e9e5b, #7ec8e3); transition: width .1s linear; border-radius: 999px; }
.pk-bar-fill.low { background: linear-gradient(90deg, #d7263d, #ff8c42); animation: pk-blink .5s steps(2) infinite; }
@keyframes pk-blink { to { filter: brightness(1.5); } }
.pk-bar-sec { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.pk-who { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin-top: auto; padding-top: 6px; }
.pk-w { position: relative; display: grid; justify-items: center; gap: 3px; opacity: .55; transition: opacity .3s, transform .3s; }
.pk-w .avatar { width: 48px; height: 48px; font-size: 20px; }
.pk-w small { font-size: 11px; font-weight: 800; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-w-tick { position: absolute; top: -4px; right: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; transform: scale(0); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.pk-w.done { opacity: 1; transform: translateY(-2px); } .pk-w.done .pk-w-tick { transform: scale(1); }
.pk-who-src .pk-w { opacity: 1; } .pk-who-src .pk-w.gone { opacity: .25; }
.pk-opts { display: grid; gap: 7px; }
.pk-opt { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.14); border-radius: 12px; padding: 9px 10px; font-weight: 800; font-size: 17px; line-height: 1.2; transition: background .3s, border-color .3s, opacity .4s, transform .3s; }
.pk-opt-text { word-break: break-word; }
.pk-let { width: 34px; height: 34px; border-radius: 9px; background: var(--brass); color: #2a1d05; font-family: var(--display); font-weight: 700; font-size: 19px; display: grid; place-items: center; grid-row: span 2; align-self: center; }
.pk-opt-meta { grid-column: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 0; }
.pk-opt-meta:empty { display: none; }
.pk-opts.reveal .pk-opt { opacity: .45; }
.pk-opts.reveal .pk-opt.shown { opacity: 1; }
.pk-opts.reveal .pk-opt.lie { background: rgba(215,38,61,.22); border-color: #d7263d; animation: pk-wobble .5s ease; }
.pk-opts.reveal .pk-opt.lie .pk-let { background: #d7263d; color: #fff; }
.pk-opts.reveal .pk-opt.dud { opacity: .7; }
.pk-opts.reveal .pk-opt.truth { background: linear-gradient(180deg, #ffe7a3, #f6c453); color: #2a1d05; border-color: #fff3c4; transform: scale(1.03); box-shadow: 0 0 0 4px rgba(246,196,83,.25), 0 12px 30px rgba(0,0,0,.4); animation: pk-wobble .6s ease; }
.pk-opts.reveal .pk-opt.truth .pk-let { background: #2a1d05; color: var(--brass); }
.pk-opts.reveal .pk-opt.truth .pk-author { background: #2a1d05; color: var(--brass); }
@keyframes pk-wobble { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(-2deg) scale(1.04); } 60% { transform: rotate(1.5deg) scale(1.04); } 100% { transform: rotate(0) scale(1); } }
.pk-opts.reveal .pk-opt.truth { animation: pk-wobble .6s ease forwards; transform: scale(1.03); }
.pk-author { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; }
.pk-fooled { display: flex; gap: 2px; align-items: center; }
.pk-chip .avatar { width: 26px; height: 26px; font-size: 11px; border: 2px solid #d7263d; }
.pk-chip.truth .avatar { border-color: #2a1d05; }
.pk-fly { position: absolute; z-index: 5; pointer-events: none; transition: transform .6s cubic-bezier(.4,1.3,.5,1); transform-origin: top left; }
.pk-fly .avatar { width: 48px; height: 48px; font-size: 20px; }

/* ladder */
.pk-ladder { display: grid; gap: 7px; align-content: start; }
.pk-lrow { display: grid; grid-template-columns: 22px 40px 1fr auto; align-items: center; gap: 8px; animation: pk-in .4s both; }
@keyframes pk-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.pk-lpos { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink-dim); text-align: center; }
.pk-lrow .avatar { width: 40px; height: 40px; font-size: 16px; }
.pk-lbar { position: relative; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); overflow: hidden; }
.pk-lfill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff3d8a, #f6c453); border-radius: 10px; transition: width .8s cubic-bezier(.2,.9,.3,1); }
.pk-lbar b { position: absolute; left: 10px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 15px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pk-lscore { font-family: var(--display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; min-width: 58px; text-align: right; display: grid; line-height: 1; }
.pk-lscore em { font-style: normal; font-size: 12px; color: var(--good); font-weight: 900; }
.pk-ladder.compact .pk-lrow { grid-template-columns: 18px 30px 1fr auto; gap: 6px; } .pk-ladder.compact .pk-lbar { height: 28px; } .pk-ladder.compact .avatar { width: 30px; height: 30px; font-size: 12px; } .pk-ladder.compact .pk-lscore { font-size: 18px; }

/* game over */
.pk-over { position: relative; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.pk-over-title { font-family: var(--display); font-weight: 700; font-size: 36px; text-align: center; color: var(--brass); text-shadow: 3px 3px 0 #1d1a14; line-height: 1; padding-top: 6px; }
.pk-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 6px; padding: 6px 4px 0; }
.pk-pod { display: grid; justify-items: center; gap: 4px; text-align: center; animation: pk-in .5s both; }
.pk-pod b { font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-pod span { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--brass); }
.pk-pod-av .avatar { width: 56px; height: 56px; font-size: 24px; }
.pk-pod.p0 .pk-pod-av .avatar { width: 76px; height: 76px; font-size: 32px; box-shadow: 0 0 0 4px var(--brass); }
.pk-pod-block { width: 100%; border-radius: 10px 10px 0 0; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 28px; }
.pk-pod.p0 .pk-pod-block { height: 74px; background: linear-gradient(180deg, #f6c453, #b8902e); } .pk-pod.p1 .pk-pod-block { height: 52px; } .pk-pod.p2 .pk-pod-block { height: 36px; }
.pk-fw { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pk-fw i { position: absolute; left: calc(7% * var(--i)); top: -10px; width: 8px; height: 14px; border-radius: 3px; background: hsl(calc(var(--i) * 40deg), 90%, 60%); animation: pk-fall 2.6s linear calc(var(--i) * .17s) 2; opacity: 0; }
@keyframes pk-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(820px) rotate(720deg); opacity: .6; } }

/* ----- phone controls ----- */
.pk-myscore { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.pk-myscore .avatar { width: 30px; height: 30px; font-size: 12px; }
.pk-myscore b { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--brass); }
.pk-myscore small { margin-left: auto; color: var(--ink-dim); font-weight: 800; letter-spacing: .08em; }
.pk-ctl-q { background: #fbf3dd; color: #1d1a14; border-radius: 12px; padding: 12px 14px; font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.25; }
.pk-ctl-q.small { font-size: 14px; padding: 8px 12px; }
.pk-form { display: flex; flex-direction: column; gap: 10px; }
.pk-form textarea { width: 100%; box-sizing: border-box; resize: none; font: inherit; font-size: 20px; font-weight: 700; padding: 12px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--ink); }
.pk-form textarea:focus { outline: none; border-color: var(--brass); }
.pk-form-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-count { font-size: 12px; font-weight: 800; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.pk-wait { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 18px 8px; }
.pk-wait-big { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--good); }
.pk-mylie { font-size: 18px; font-weight: 800; font-style: italic; color: var(--brass); }
.pk-ctl-note { text-align: center; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--ink-dim); }
.pk-pick { display: grid; gap: 8px; }
.pk-pbtn { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 12px 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--ink); font: inherit; font-weight: 800; font-size: 17px; line-height: 1.2; cursor: pointer; }
.pk-pbtn:active { transform: scale(.98); }
.pk-pbtn.mine { opacity: .45; border-style: dashed; cursor: default; }
.pk-pbtn.mine em { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.pk-pbtn.picked { background: linear-gradient(180deg, #ffe7a3, #f6c453); color: #2a1d05; border-color: #fff3c4; opacity: 1; }
.pk-pbtn.picked .pk-let { background: #2a1d05; color: var(--brass); }
.pk-pbtn:disabled:not(.mine):not(.picked) { opacity: .5; }
.pk-result { display: grid; gap: 8px; }
.pk-res { padding: 14px 14px; border-radius: 14px; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2; background: rgba(255,255,255,.08); animation: pk-in .4s both; }
.pk-res.good { background: rgba(46,158,91,.3); border: 2px solid var(--good); }
.pk-res.bad { background: rgba(215,38,61,.25); border: 2px solid var(--bad); }
.pk-res.meh { color: var(--ink-dim); font-size: 16px; }
.pk-res.truth { background: #fbf3dd; color: #1d1a14; font-size: 16px; }
.pk-ctl-foot { margin-top: auto; display: grid; gap: 8px; text-align: center; }

/* ----- TV: the stage is drawn at 390x780 and scaled; make it louder ----- */
#porkiesRoot.pk-tv .pk-stage { padding: 10px 14px 14px; gap: 10px; }
#porkiesRoot.pk-tv .pk-q { font-size: 26px; } #porkiesRoot.pk-tv .pk-q.long { font-size: 20px; }
#porkiesRoot.pk-tv .pk-opt { font-size: 19px; padding: 10px 10px; }
#porkiesRoot.pk-tv .pk-w .avatar { width: 54px; height: 54px; font-size: 22px; }
body.tv #porkies .topbar-actions { display: none; }

/* six or seven options: tighten so the stage still fits 780px */
.pk-q.many { font-size: 18px; padding: 10px 14px; } .pk-q.many.long { font-size: 15px; }
.pk-opts.many { gap: 5px; } .pk-opts.many .pk-opt { padding: 6px 8px; font-size: 15px; } .pk-opts.many .pk-let { width: 28px; height: 28px; font-size: 15px; }
.pk-opts.many ~ .pk-who .pk-w .avatar, #porkiesRoot.pk-tv .pk-opts.many ~ .pk-who .pk-w .avatar { width: 34px; height: 34px; font-size: 14px; }
.pk-opts.many ~ .pk-who { gap: 4px 8px; } .pk-opts.many ~ .pk-who .pk-w small { font-size: 10px; }
#porkiesRoot.pk-tv .pk-q.many { font-size: 19px; } #porkiesRoot.pk-tv .pk-opts.many .pk-opt { font-size: 16px; padding: 7px 8px; }

/* no telly: the stage sits above the controls, so trim what the controls already show */
#porkiesRoot.pk-both .pk-stage[data-phase="pick"] .pk-opts { display: none; }
#porkiesRoot.pk-both .pk-stage[data-phase="reveal"] { max-height: 62%; }
#porkiesRoot.pk-both .pk-stage[data-phase="reveal"] .pk-q, #porkiesRoot.pk-both .pk-stage[data-phase="reveal"] .pk-who-src { display: none; }
#porkiesRoot.pk-both .pk-stage[data-phase="gameover"] { max-height: 70%; }
