/* Arcade: trial — Gym speed challenge as a battle (assets/arcade/trial.js) */
.trhead .trtitle{white-space:nowrap;font-weight:900;color:#fff;font-size:.95rem}
.trhead .trclock{font-variant-numeric:tabular-nums;font-size:1.25rem;min-width:4.2em;text-align:right}
@media (max-width:420px){.trhead .trtitle{display:none}}

#app>main.trg{transition:background .6s}
.trg.final{animation:trpulse .9s infinite alternate}
@keyframes trpulse{to{filter:saturate(1.3) brightness(1.08)}}
.trg .chip{color:#fff}
.trg .fxg-hud{justify-content:center;flex-wrap:wrap;gap:8px;padding-top:8px}
.trg .fxg-play{padding-top:0;padding-bottom:0;overflow:hidden}

/* the pace hint */
.trpace{transition:background .3s}
.trpace.g{background:#c98a00;color:#fff}.trpace.s{background:#7d8aa6;color:#fff}.trpace.b{background:#a4602e;color:#fff}.trpace.x{background:#6b2a2a;color:#ffd0d0}
.trpen{opacity:.35}.trpen.on{opacity:1;background:#a02a20}

/* the arena: buddy on the left, leader on the right */
.trarena{flex:1;min-height:0;width:100%;max-width:900px;display:flex;align-items:center;justify-content:space-between;gap:4px;position:relative}
.trarena:before{content:"";position:absolute;left:4%;right:4%;bottom:8%;height:26%;border-radius:50%;background:radial-gradient(closest-side,rgba(255,255,255,.18),transparent);pointer-events:none}
.trside{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.trg .trside .fxactor.big{width:clamp(84px,min(40vw,26vh),280px)}
.trdone .trside .fxactor.big{width:clamp(70px,min(30vw,16vh),200px)}
.trvs{flex:none;font-weight:900;font-size:clamp(20px,5vmin,40px);color:#ffc928;-webkit-text-stroke:4px #1b1f2e;paint-order:stroke fill;transform:rotate(-8deg)}
.trtag{width:min(100%,240px);text-align:center;background:rgba(15,18,32,.6);border:3px solid #0f1220;border-radius:12px;padding:4px 8px}
.trtag>b{display:block;font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trsh{display:flex;justify-content:center;align-items:center;gap:4px;font-size:1rem;height:20px}
.trsh i{font-style:normal;transition:opacity .3s,filter .3s}.trsh i.broke{opacity:.35;filter:grayscale(1)}
.trsh b{font-size:.7rem;color:#ff9a8a;margin-left:4px}

/* the leader's HP: a ghost bar trails the real one */
.trhp{position:relative;height:18px;margin-top:2px;border-radius:8px;background:#2a3148;border:3px solid #0f1220;overflow:hidden}
.trhp i{position:absolute;left:0;top:0;bottom:0}
.trhp .gh{background:#fff;transition:width .6s .25s ease-out}
.trhp .fl{background:linear-gradient(#7be36b,#38a83a);transition:width .18s ease-out}
.trhp.mid .fl{background:linear-gradient(#ffd75a,#e0a400)}.trhp.low .fl{background:linear-gradient(#ff7b6b,#c9302c)}
.trhp span{position:relative;display:block;font-size:.66rem;line-height:12px;font-weight:900;text-shadow:0 1px 0 #0f1220}

/* question + answers */
.trg .fxg-foot{display:flex;flex-direction:column;gap:8px;max-width:900px;width:100%;margin:0 auto;padding-inline:max(12px,env(safe-area-inset-left))}
.trq{background:#fff;color:#1b1f2e;border:3px solid #1b1f2e;border-radius:12px;box-shadow:0 5px 0 #0f1220;text-align:center;padding:8px 12px}
.trlabel{font-size:.78rem;font-weight:800;color:#5b6480}
.trq .q-big{font-size:clamp(1.6rem,6vmin,2.8rem);line-height:1.15;word-break:break-word}
.trq .q-em{font-size:clamp(1.8rem,6vmin,3rem);line-height:1.1}.trq .q-def{font-size:clamp(.95rem,2.6vmin,1.3rem)}
.trg .trops{display:grid;grid-template-columns:1fr;gap:7px}
.trg .trops .opt{min-height:46px;padding:7px 10px;font-size:clamp(.86rem,2.4vmin,1.1rem);color:#1b1f2e;line-height:1.2;gap:8px}
.trg .trops .opt kbd{width:22px;height:22px}
@media (min-width:640px){.trg .trops{grid-template-columns:1fr 1fr;gap:10px}.trg .trops .opt{min-height:60px}}

/* ready screen */
.trcard{background:rgba(15,18,32,.55);border-top:3px solid #0f1220;text-align:center}
.trcard h2{margin:0;font-size:1.4rem}
.trcard p{margin:0;font-size:.92rem;color:#e6ebff}
.trmedals{display:flex;justify-content:center;flex-wrap:wrap;gap:6px}
.trmedals span{background:rgba(255,255,255,.12);border:2px solid #0f1220;border-radius:10px;padding:3px 9px;font-weight:800;font-size:.85rem}
.trbest{font-weight:900;color:#ffc928}
.trrow{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.trrow .btn{margin:0}

/* result: slides up after the K.O., the medal pops in with the fanfare */
.trdone .fxg-play{flex:0 1 34%}
.trres{flex:1;min-height:0;overflow-y:auto;text-align:center;background:rgba(15,18,32,.62);border-top:3px solid #0f1220;
  transform:translateY(105%);opacity:0;transition:transform .5s cubic-bezier(.2,1.3,.4,1),opacity .3s}
.trres.show{transform:none;opacity:1}
.trres h1{margin:0;font-size:2rem;font-variant-numeric:tabular-nums}
.trres p{margin:0}
.trres .banner{color:#1b1f2e}
.trres .hint{color:#e6ebff}
.trmedal{font-size:clamp(56px,14vmin,96px);line-height:1.1;transform:scale(0) rotate(-200deg)}
.trmedal.pop{animation:trmedal .8s cubic-bezier(.2,1.5,.4,1) forwards}
.trmedal.m0.pop{filter:drop-shadow(0 0 18px #ffc928)}
@keyframes trmedal{to{transform:none}}
@media (prefers-reduced-motion:reduce){.trres{transform:none;opacity:1}.trmedal{transform:none}}
.trres{display:flex;flex-direction:column;gap:8px;padding-bottom:0}
.trres>*{flex:none}
.trres .banner{margin:0;padding:8px 12px}
.trres .gymwin img,.trres .gymwin .monf{max-height:min(90px,10vh);width:auto}
.trres>.trrow:last-child{position:sticky;bottom:0;margin-top:auto;padding:8px 0 calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(15,18,32,.95) 30%)}
@media (min-aspect-ratio:1/1){
  .trdone .fxg-play{flex-basis:24%}.trdone .trside .fxactor.big{width:clamp(60px,14vh,160px)}
  .trmedal{font-size:clamp(48px,10vh,84px)}.trres h1{font-size:1.6rem}
}
.trmedal.popped{transform:none}
.trres .row{flex-wrap:wrap}
.trres .gymwin:has(>img){display:flex;flex-direction:row;align-items:center;gap:10px;text-align:left;padding:6px 10px}.trres .gymwin img,.trres .gymwin .monf{max-height:min(64px,8vh);flex:none}
.trres .row{display:flex;gap:8px;justify-content:center}.trres .row .btn{margin:0}
.trq .q-sent{font-size:clamp(1rem,2.8vmin,1.35rem);font-weight:800;line-height:1.3}
