/* ALL-22 BOWL — modes: DRAFT YOUR TEAM + GYM CHALLENGE (game/modes*.js). Owner: modes team.
   Same look as play.css: Press Start 2P, hard pixel borders (stepped box-shadows), palette colors,
   stepped animations, no rounded corners / soft gradients / blur. Every class is prefixed mo-.
   Pixel art lives on <canvas class="mo-px"> sized in whole device pixels by modes-art.js. */

.mo-px { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- shared ---------- */
.screen.mo-screen {
  background-color: rgba(11, 13, 20, 0.9);
  background-image: repeating-linear-gradient(135deg, rgba(43, 58, 107, 0.16) 0 2px, transparent 2px 10px);
  justify-content: flex-start;
  justify-content: safe center;
  padding: calc(16px + var(--safe-t, 0px)) calc(16px + var(--safe-r, 0px)) calc(18px + var(--safe-b, 0px)) calc(16px + var(--safe-l, 0px));
  overflow-y: auto;
  touch-action: pan-y;
}
.mo-screen > * { flex-shrink: 0; }
.mo-title { letter-spacing: 2px; }
/* a screen title stands clear of what follows (the core wraps its titles in .stitle-wrap for the same gap) */
.mo-screen > .stitle { margin-bottom: calc(14px * var(--ui)); }
.mo-panel { max-width: min(100%, 780px); }
.mo-note { font-family: var(--body); font-size: 12px; color: #9aa6c8; text-align: center; margin-top: 6px; line-height: 1.4; }
.mo-chipcolor { display: inline-block; width: 12px; height: 12px; background: var(--c, var(--red)); box-shadow: 2px 2px 0 0 var(--ink), -2px 0 0 0 var(--white), 0 -2px 0 0 var(--white), 2px 0 0 0 var(--white), 0 2px 0 0 var(--white); flex: none; }
.mo-chipcolor.big { width: 16px; height: 16px; }
.mo-type { display: inline-block; font-size: var(--fx); padding: calc(var(--fx) * 0.375) calc(var(--fx) / 2) calc(var(--fx) / 4); background: var(--ty); color: var(--white); text-shadow: 1px 1px 0 var(--ink); box-shadow: 0 2px 0 0 rgba(11, 13, 20, 0.6); }
.mo-type.ink { color: var(--ink); text-shadow: none; }
.mo-stars { letter-spacing: 1px; font-size: var(--fs); white-space: nowrap; }
.mo-stars i { font-style: normal; color: #3b456b; }
.mo-stars i.on { color: var(--yellow); }
.pbtn.mo-mini { padding: 6px 7px 5px; margin: 0 0 0 6px; font-size: var(--fs); }
.pbtn.mo-gold { background: #b8860b; color: var(--white); }
.pbtn.mo-gold:hover, .pbtn.mo-gold:focus { background: var(--yellow); color: var(--ink); }
@keyframes mo-blink { 50% { opacity: 0; } }
@keyframes mo-bob { 50% { transform: translateY(-4px); } }
.mo-bounce { animation: mo-bob 0.8s steps(2) infinite; }

/* bars: 10 pixel segments; the draft cards fill them one by one */
.mo-bar { display: inline-flex; gap: 1px; vertical-align: middle; }
.mo-bar b { display: block; width: 6px; height: 8px; background: #26305a; }
.mo-bar b.on.hi { background: var(--green); }
.mo-bar b.on.mid { background: var(--yellow); }
.mo-bar b.on.lo { background: var(--orange); }
.mo-bar.fit b { width: 8px; }
.mo-bar.fit b.on.hi { background: var(--cyan); }
.mo-bar.fit b.on.mid { background: #7fb2ff; }
.mo-bar.fit b.on.lo { background: #8d99ae; }

/* ---------- title: the two mode entries ---------- */
.mo-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin: 0 6px; }
.title .menu .mo-entry .pbtn, .mo-entry .pbtn {
  font-size: var(--fs); margin: 8px 0; padding: 8px 12px 7px; display: flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
  box-shadow: inset 0 4px 0 0 var(--acc), 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink);
}
.mo-entry .pbtn:focus::before { content: none; }
.mo-entry .pbtn:focus { box-shadow: inset 0 4px 0 0 var(--acc), 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink); }
.mo-entry-draft { --acc: var(--pink); }
.mo-entry-gyms { --acc: var(--yellow); }
.mo-entry-ic { flex: none; }

/* ---------- team select: YOUR DRAFT as a third card ---------- */
.cards.mo-three { gap: 18px; flex-wrap: nowrap; }
.cards.mo-three .team-card { width: min(380px, 31vw); }
/* in a row (760 px and wider): the three cards with their gaps and frames fit inside the screen's padding */
@media (min-width: 760px) { .cards.mo-three .team-card { width: min(380px, 31vw, calc((100vw - 68px - 12 * var(--bw)) / 3)); } }
.mo-empty-art { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; gap: 8px; border-bottom: 4px solid var(--ink); background: repeating-linear-gradient(135deg, #1b2547 0 4px, #22305c 4px 8px); }
.mo-empty-art canvas:nth-child(2) { transform: translateY(-8px); }
.mo-empty-card .card-head { background: var(--pink); }
.mo-empty-go { font-size: var(--fs); color: var(--cyan); padding-bottom: 12px; }
.mo-draft-card:hover .mo-empty-go, .mo-draft-card:focus .mo-empty-go { color: var(--yellow); }

/* ---------- DRAFT: intro ---------- */
.mo-dintro { justify-content: safe center; }
.mo-lead { display: flex; justify-content: center; gap: 10px; font-size: var(--fs); color: var(--cyan); margin: -6px 0 16px; flex-wrap: wrap; }
.mo-lead i { font-style: normal; color: #55608a; }
.mo-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 14px; }
.mo-step { background: var(--navy2); padding: 12px 10px; text-align: center; box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.mo-step-art { height: 72px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.mo-step-art canvas:nth-child(2) { transform: translateY(-6px); }
.mo-step-fit { gap: 8px; font-size: var(--fx); color: #9aa6c8; }
.mo-step-fit b { color: var(--ink); background: var(--yellow); padding: 4px 5px 3px; font-size: var(--fs); }
.mo-step-heads { gap: 6px; }
.mo-step-heads canvas { background: var(--navy); box-shadow: 0 0 0 2px var(--line); }
.mo-step-t { font-size: var(--fs); color: var(--yellow); margin: 8px 0 6px; }
.mo-step-d { font-family: var(--body); font-size: 12px; color: #c9d1e8; line-height: 1.4; }
.mo-scheme { display: flex; justify-content: center; gap: 8px 26px; flex-wrap: wrap; }
.mo-set { margin: 4px 0; }
.mo-current { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs); color: var(--white); margin-top: 14px; flex-wrap: wrap; }
.mo-current .pbtn { margin: 0; }

/* ---------- DRAFT: a round ---------- */
.mo-draft { padding-top: calc(10px + var(--safe-t, 0px)); }
.mo-dtop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: min(100%, 1060px); margin-bottom: 14px; }
.mo-dround { font-size: var(--fs); color: #9aa6c8; display: flex; align-items: baseline; gap: 6px; }
.mo-dround b { font-size: var(--fh); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }
.mo-dslot { text-align: center; }
.mo-dslot-tag { display: inline-block; font-size: var(--fs); color: var(--white); background: var(--red); padding: calc(var(--fs) * 0.75) calc(var(--fs) * 0.875) calc(var(--fs) * 0.625); box-shadow: 0 4px 0 0 var(--ink); }
.mo-dslot-name { font-size: var(--fl); color: var(--white); margin-top: 10px; text-shadow: 3px 3px 0 var(--ink); letter-spacing: 1px; white-space: nowrap; }
.mo-dovr { text-align: right; justify-self: end; }
.mo-dovr span { display: block; font-size: var(--fx); color: #9aa6c8; }
.mo-dovr b { display: block; font-size: var(--fh); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); margin: 4px 0; }
.mo-dovr small { display: block; font-size: var(--fx); color: #9aa6c8; }
.mo-dovr b { position: relative; }
.mo-delta { position: absolute; right: calc(100% + 6px); top: 4px; font-style: normal; font-size: var(--fs); text-shadow: 2px 2px 0 var(--ink); animation: mo-rise 0.9s steps(3) both; }
.mo-delta.up { color: var(--green); }
.mo-delta.down { color: var(--orange); }
@keyframes mo-rise { 0% { transform: translateY(8px); opacity: 0; } 34% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }

.mo-dcards { display: flex; gap: 26px; justify-content: center; align-items: stretch; }
.mo-card { position: relative; background: transparent; border: 0; padding: 0; margin: 4px; cursor: pointer; outline: none; font-family: var(--font); color: var(--white); text-align: left; animation: mo-deal 0.36s steps(4) backwards; animation-delay: calc(var(--i) * 0.09s); }
@keyframes mo-deal { 0% { transform: translateY(-48px); opacity: 0; } 25% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.mo-card-in { position: relative; animation: mo-flip 0.42s steps(3) backwards; animation-delay: calc(0.26s + var(--i) * 0.12s); }
@keyframes mo-flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0.04); } 100% { transform: scaleX(1); } }
.mo-cfront, .mo-cback {
  background: var(--navy);
  box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink);
}
.mo-cfront { display: flex; flex-direction: column; gap: 7px; padding: 0 0 10px; min-width: 196px; }
.mo-cback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #1b2547 0 4px, #22305c 4px 8px); animation: mo-hide 0.42s steps(1) both; animation-delay: calc(0.26s + var(--i) * 0.12s); }
@keyframes mo-hide { 0% { visibility: visible; } 50%, 100% { visibility: hidden; } }
/* the cursor: .sel (modes-ui.js keeps it on the card Enter drafts, like the core UI's select()) */
.mo-card.sel .mo-cfront { box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink); }
.mo-card.sel { transform: translateY(-4px); }
.mo-chead { display: flex; align-items: center; gap: 8px; padding: 6px 8px 5px; background: var(--ty); text-shadow: 1px 1px 0 var(--ink); border-bottom: 4px solid var(--ty2); }
.mo-key { font-size: var(--fx); background: var(--yellow); color: var(--ink); text-shadow: none; padding: 3px 5px 2px; }
.mo-dex { font-size: var(--fx); color: var(--white); flex: 1; }
.mo-card.ink-head .mo-dex { color: var(--ink); text-shadow: none; }
.mo-grade { font-size: var(--fs); padding: 3px 5px 2px; color: var(--ink); text-shadow: none; background: #8d99ae; box-shadow: 2px 2px 0 0 var(--ink); }
.mo-grade.g-S { background: var(--yellow); }
.mo-grade.g-A { background: var(--green); }
.mo-grade.g-B { background: var(--cyan); }
.mo-grade.g-C { background: var(--orange); }
.mo-cart { position: relative; display: flex; justify-content: center; padding: 2px 10px 0; background: repeating-conic-gradient(#121a33 0 25%, #0f1630 0 50%) 0 0 / 8px 8px; }
.mo-cflash { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); opacity: 0; animation: mo-flash 0.3s steps(1) both; animation-delay: calc(0.47s + var(--i) * 0.12s); pointer-events: none; }
@keyframes mo-flash { 0% { opacity: 1; } 34% { opacity: 0.75; } 67% { opacity: 0.25; } 100% { opacity: 0; } }
.mo-cname { font-size: var(--fm); color: var(--yellow); padding: 0 10px; white-space: nowrap; text-shadow: 2px 2px 0 var(--ink); }
.mo-ctypes { display: flex; gap: 4px; padding: 0 10px; min-height: 14px; }
.mo-fit, .mo-stat { display: grid; grid-template-columns: calc(var(--fx) * 3) auto calc(var(--fx) * 2); align-items: center; gap: 6px; padding: 0 10px; font-size: var(--fx); color: #9aa6c8; }
.mo-fit { color: var(--cyan); padding-top: 4px; border-top: 2px solid var(--line); margin: 0 6px; padding-left: 4px; padding-right: 4px; }
.mo-fit b, .mo-stat b { color: var(--white); text-align: right; font-weight: normal; }
.mo-stats { display: flex; flex-direction: column; gap: 4px; }
.mo-card .mo-bar b.on { animation: mo-seg 0.01s steps(1) both; animation-delay: calc(0.62s + var(--i) * 0.12s + var(--j) * 0.035s); }
@keyframes mo-seg { from { background: #26305a; } }
.mo-card.picked { animation: mo-pick 0.42s steps(3) both; animation-delay: 0s; z-index: 2; }
.mo-card.picked .mo-cfront { box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink); background: var(--line); }
@keyframes mo-pick { 0% { transform: translateY(-4px); } 34% { transform: translateY(-16px); } 67% { transform: translateY(-16px); opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }
.mo-card.discard { animation: mo-discard 0.36s steps(3) both; animation-delay: 0s; }
@keyframes mo-discard { to { transform: translateY(46px); opacity: 0; } }

/* rare pulls show on the grade badge, never on the frame (the yellow frame is only ever the cursor):
   S = holo badge with a stepped white glint and a twinkling star, A = gold foil badge with a star */
.mo-grade.g-S, .mo-grade.g-A { position: relative; overflow: hidden; }
.mo-card.g-S .mo-grade { background-color: var(--yellow); background-image: linear-gradient(var(--white), var(--white)); background-size: 2px 100%; background-repeat: no-repeat; background-position: -4px 0;
  animation: mo-glint 1.8s steps(1) infinite, mo-holo 2.4s steps(1) infinite; animation-delay: calc(0.7s + var(--i) * 0.12s); }
@keyframes mo-glint { 0% { background-position: -4px 0; } 6% { background-position: 0 0; } 12% { background-position: 4px 0; } 18% { background-position: 8px 0; } 24% { background-position: 12px 0; } 30% { background-position: 16px 0; } 36%, 100% { background-position: 40px 0; } }
@keyframes mo-holo { 0% { background-color: var(--yellow); } 25% { background-color: #ff9ed0; } 50% { background-color: #8fe3ff; } 75% { background-color: #9cf09c; } }
.mo-card.g-A .mo-grade { background: #f4a81d; box-shadow: inset 2px 2px 0 0 #ffe08a, 2px 2px 0 0 var(--ink); }
.mo-card.g-S .mo-chead::after, .mo-card.g-A .mo-chead::after { content: "★"; font-size: var(--fx); color: var(--yellow); text-shadow: 1px 1px 0 var(--ink); }
.mo-card.g-S .mo-chead::after { animation: mo-blink 0.9s steps(2) infinite; }

.mo-dbar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.mo-dbar .pbtn { margin: 4px; }
.mo-dhint { font-size: var(--fx); color: #8d99ae; }
.mo-strip { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 12px; max-width: 100%; }
.mo-sgroup-t { font-size: var(--fx); color: #9aa6c8; margin: 0 0 5px 2px; }
.mo-srow { display: flex; gap: 4px; }
.mo-sslot { background: var(--navy2); padding: 3px 3px 3px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 -2px 0 0 #2b3a6b, 0 2px 0 0 #2b3a6b, -2px 0 0 0 #2b3a6b, 2px 0 0 0 #2b3a6b; }
.mo-sslot-tag { font-size: var(--fx); color: #6f7aa3; white-space: nowrap; }
.mo-sslot.full .mo-sslot-tag { color: var(--white); }
.mo-sslot-empty { display: block; background: repeating-linear-gradient(135deg, #1b2547 0 2px, #141c38 2px 4px); }
.mo-sslot.now { box-shadow: 0 -2px 0 0 var(--yellow), 0 2px 0 0 var(--yellow), -2px 0 0 0 var(--yellow), 2px 0 0 0 var(--yellow); }
.mo-sslot.now .mo-sslot-tag { color: var(--yellow); animation: mo-blink 0.7s steps(2) infinite; }
.mo-sslot.filling { animation: mo-pop 0.4s steps(4) both; background: var(--line); }
@keyframes mo-pop { 0% { transform: translateY(-6px); } 50% { transform: translateY(2px); } 100% { transform: none; } }
.mo-head { background: var(--navy); }

/* ---------- DRAFT: complete ---------- */
.mo-ddone { justify-content: safe center; }
.mo-ddone > .mo-confetti { position: absolute; inset: 0; }
.mo-done-body { display: flex; gap: 26px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mo-done-field { padding: 4px; background: var(--ink); box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 8px 0 0 var(--ink); }
/* --fsc = the field's sprite scale (set by modes-ui.js). Rows sit 15% apart, so the field is tall enough for a
   headshot plus its spot tag under it (the tag uses the core --fx size) */
.mo-form { position: relative; width: calc(330px * var(--fsc)); height: max(calc(196px * var(--fsc)), calc(147px * var(--fsc) + var(--fx) * 8 + 28px)); background: repeating-linear-gradient(0deg, #2f8f3a 0 calc(17px * var(--fsc)), #2a8034 calc(17px * var(--fsc)) calc(34px * var(--fsc))); }
.mo-form::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(33px * var(--fsc) - 1px), rgba(238, 244, 234, 0.35) calc(33px * var(--fsc) - 1px) calc(33px * var(--fsc))); pointer-events: none; }
.mo-form-los { position: absolute; left: 0; right: 0; top: 47%; height: 2px; background: #4aa3ff; }
.mo-form-p { position: absolute; transform: translate(-50%, -50%); padding: 1px; background: var(--ink); box-shadow: 0 2px 0 0 var(--c), 2px 2px 0 0 var(--ink); }
.mo-form-p .mo-head { background: #1b2547; }
.mo-form-tag { position: absolute; left: 50%; top: calc(100% + 1px); transform: translateX(-50%); font-size: var(--fx); color: var(--white); background: var(--ink); padding: 1px 2px 0; white-space: nowrap; line-height: 1.2; z-index: 1; }
.mo-done-side { display: flex; flex-direction: column; gap: 12px; min-width: 300px; max-width: 380px; }
.mo-tname { display: flex; align-items: center; gap: 10px; }
.mo-tname-t { font-size: var(--fl); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); line-height: 1.3; }
.mo-tsub { font-size: var(--fx); color: #9aa6c8; }
.mo-swatches { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 2px; }
.mo-swatch { width: 22px; height: 22px; border: 0; padding: 0; background: var(--c); cursor: pointer; outline: none; box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line), 2px 4px 0 0 var(--ink); }
.mo-swatch.on, .mo-swatch:focus, .mo-swatch:hover { box-shadow: 0 -3px 0 0 var(--yellow), 0 3px 0 0 var(--yellow), -3px 0 0 0 var(--yellow), 3px 0 0 0 var(--yellow), 3px 6px 0 0 var(--ink); }
.mo-ovrs { display: flex; align-items: center; gap: 14px; }
.mo-ovr-big { display: flex; flex-direction: column; align-items: center; background: var(--navy); padding: 8px 12px 6px; box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow); }
.mo-ovr-big b { font-size: var(--fh); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); font-weight: normal; }
.mo-ovr-big small { font-size: var(--fx); color: #9aa6c8; margin-top: 4px; }
.mo-ovr-grade { font-size: var(--fh); padding: 8px 10px 6px; color: var(--ink); background: #8d99ae; box-shadow: 3px 3px 0 0 var(--ink); }
.mo-ovr-grade.g-S { background: var(--yellow); }
.mo-ovr-grade.g-A { background: var(--green); }
.mo-ovr-grade.g-B { background: var(--cyan); }
.mo-ovr-grade.g-C { background: var(--orange); }
.mo-ovr-od { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs); color: var(--white); }
.mo-done-stars { display: flex; gap: 6px; }
.mo-done-btns { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.mo-done-btns .pbtn { margin: 6px 0; }

/* ---------- GYM CHALLENGE: ladder ---------- */
.mo-ladder { padding-top: calc(12px + var(--safe-t, 0px)); }
.mo-lhead { display: flex; align-items: center; justify-content: center; gap: 10px 28px; flex-wrap: wrap; margin-bottom: 12px; }
.mo-lhead .stitle { margin: 0; }
.mo-lttl { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.mo-lsub { font-size: var(--fx); color: var(--cyan); letter-spacing: 1px; }
.mo-shout { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); z-index: 3; font-size: var(--fm); color: var(--yellow); white-space: nowrap; text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--ink); animation: mo-shout 0.42s steps(3) both; pointer-events: none; }
@keyframes mo-shout { 0% { transform: translateX(-50%) scale(2); opacity: 0; } 34% { transform: translateX(-50%) scale(1); opacity: 1; } 67% { transform: translateX(-50%) translateY(-4px); opacity: 1; } 100% { transform: translateX(-50%) translateY(-8px); opacity: 1; } }
.mo-lprog { display: flex; align-items: center; gap: 4px; background: var(--ink); padding: 5px 8px; box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.mo-lprog-n { font-size: var(--fx); color: var(--yellow); margin-left: 8px; white-space: nowrap; }
.mo-lbody { display: flex; gap: 22px; align-items: flex-start; justify-content: center; }
.mo-lmap { position: relative; flex: none; padding: 0; box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink); }
.mo-node { position: absolute; width: var(--s); height: var(--s); transform: translate(-50%, -50%); background: transparent; border: 0; padding: 0; cursor: pointer; outline: none; }
.mo-node-n { position: absolute; left: calc(100% - 2px); top: calc(var(--fx) * -0.75); font-size: var(--fx); line-height: 1; color: var(--white); background: var(--ink); padding: 2px 2px 1px 3px; box-shadow: 1px 1px 0 0 rgba(11, 13, 20, 0.6); pointer-events: none; z-index: 1; }
.mo-node.next .mo-node-n { color: var(--yellow); }
.mo-node.locked .mo-node-n { color: #8d99ae; }
.mo-cursor { position: absolute; width: var(--s); height: var(--s); transform: translate(-50%, -50%); pointer-events: none; animation: mo-blink 0.8s steps(2) infinite;
  background:
    linear-gradient(var(--yellow), var(--yellow)) 0 0 / 30% 3px no-repeat, linear-gradient(var(--yellow), var(--yellow)) 0 0 / 3px 30% no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 0 / 30% 3px no-repeat, linear-gradient(var(--yellow), var(--yellow)) 100% 0 / 3px 30% no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 0 100% / 30% 3px no-repeat, linear-gradient(var(--yellow), var(--yellow)) 0 100% / 3px 30% no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 100% / 30% 3px no-repeat, linear-gradient(var(--yellow), var(--yellow)) 100% 100% / 3px 30% no-repeat; }
.mo-lside { display: flex; flex-direction: column; gap: 16px; width: min(400px, 44vw); }
@media (min-height: 900px) and (min-width: 1500px) {
  .mo-lside { width: 460px; }
  .mo-case { width: min(100%, 900px); }
}
.mo-gcard { background: var(--navy); padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 9px; border-top: 6px solid var(--tc); box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 8px 0 0 var(--ink), 4px 4px 0 0 var(--ink); }
.mo-gcard .pbtn { align-self: flex-start; margin: 4px 0 2px; }
.mo-gtop { display: flex; align-items: center; gap: 12px; }
.mo-gbadge { flex: none; }
.mo-gnum { font-size: var(--fx); color: #9aa6c8; margin-bottom: 6px; }
.mo-gname { font-size: var(--fm); color: var(--white); text-shadow: 2px 2px 0 var(--ink); margin-bottom: 7px; line-height: 1.3; }
.mo-glead { display: flex; align-items: center; gap: 8px; font-size: var(--fs); color: var(--tc2, var(--cyan)); }
.mo-gmeta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--fx); }
.mo-govr { color: var(--yellow); }
.mo-gstyle { font-size: var(--fx); color: var(--ink); background: var(--cyan); padding: 3px 5px 2px; white-space: nowrap; }
.mo-gaces { display: flex; gap: 2px; min-height: 64px; align-items: flex-end; padding: 0 2px; background: repeating-conic-gradient(#121a33 0 25%, #0f1630 0 50%) 0 0 / 8px 8px; }
.mo-gstatus { font-size: var(--fx); line-height: 1.5; color: var(--cyan); }
.mo-gcard.won .mo-gstatus { color: var(--green); }
.mo-gcard.locked .mo-gstatus { color: #8d99ae; }
.mo-gcard.locked .mo-gaces { opacity: 0.45; }
.mo-lteam { background: var(--navy2); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.mo-lteam-t { font-size: var(--fx); color: #9aa6c8; }
.mo-lteam-seg .pbtn { font-size: var(--fs); padding: 8px 9px 7px; margin: 4px 6px 4px 0; }
.mo-lteam-info { display: flex; align-items: center; gap: 9px; font-size: var(--fs); }
.mo-lteam-name { color: var(--white); }
.mo-lteam-ovr { color: var(--yellow); margin-left: auto; }
.mo-lteam-heads { display: flex; gap: 3px; flex-wrap: wrap; }
.mo-lnav { margin-top: 16px; }

/* ---------- GYM CHALLENGE: VS ---------- */
.mo-vs { justify-content: safe center; gap: 14px; background-color: rgba(11, 13, 20, 0.92); }
.mo-vs-band { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; width: min(100%, 1100px); gap: 0; }
.mo-vs-side { padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; position: relative; }
.mo-vs-you { background: var(--navy); border-left: 8px solid var(--uc); animation: mo-in-l 0.4s steps(4) both; align-items: flex-start; }
.mo-vs-gym { background: var(--navy); border-right: 8px solid var(--tc); animation: mo-in-r 0.4s steps(4) both; align-items: flex-end; text-align: right; }
@keyframes mo-in-l { from { transform: translateX(-60vw); } }
@keyframes mo-in-r { from { transform: translateX(60vw); } }
.mo-vs-label { font-size: var(--fx); color: #9aa6c8; }
.mo-vs-name { font-size: var(--fh); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); line-height: 1.2; }
.mo-vs-sub { font-size: var(--fs); color: var(--white); }
.mo-vs-mons { display: flex; gap: 0; align-items: flex-end; margin-top: 6px; }
.mo-vs-mon { animation: mo-hop 0.6s steps(2) infinite; animation-delay: calc(var(--i) * 0.2s); }
@keyframes mo-hop { 50% { transform: translateY(-3px); } }
.mo-vs-meta { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.mo-vs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; background: var(--ink); }
.mo-vs-vs { font-size: var(--fxl); color: var(--red); text-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--ink); animation: mo-slam 0.5s steps(4) both 0.35s; }
@keyframes mo-slam { 0% { transform: scale(3); opacity: 0; } 50% { transform: scale(0.8); opacity: 1; } 75% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.mo-vs-badge { animation: mo-bob 0.9s steps(2) infinite; }
.mo-vs-prize { font-size: var(--fx); color: var(--yellow); white-space: nowrap; }
.mo-textbox { position: relative; width: min(100%, 900px); background: var(--white); color: var(--ink); padding: 14px 18px 16px; font-size: var(--fm); line-height: 1.6; min-height: 58px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 0 -8px 0 0 var(--tc), 0 8px 0 0 var(--tc), -8px 0 0 0 var(--tc), 8px 0 0 0 var(--tc), 0 12px 0 0 var(--ink); }
.mo-tb-name { color: var(--red); margin-right: 10px; }
.mo-tb-arrow { position: absolute; right: 14px; bottom: 8px; font-style: normal; font-size: var(--fs); color: var(--red); visibility: hidden; }
.mo-textbox.done .mo-tb-arrow { visibility: visible; animation: mo-blink 0.6s steps(2) infinite; }

/* ---------- the badge moment ---------- */
.modal.mo-badge-modal { background: rgba(11, 13, 20, 0.78); }
.mo-bm { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: min(90vw, 460px); border-top: 6px solid var(--tc); }
.mo-bm-top { font-size: var(--fh); color: var(--yellow); text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink); animation: mo-slam 0.5s steps(4) both; }
.mo-bm-stage { position: relative; }
.mo-bm-badge { animation: mo-drop 0.6s steps(5) both 0.2s; }
@keyframes mo-drop { 0% { transform: translateY(-80px); opacity: 0; } 60% { transform: translateY(6px); opacity: 1; } 80% { transform: translateY(-3px); } 100% { transform: none; opacity: 1; } }
.mo-spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; background: var(--yellow); box-shadow: 6px 0 0 0 var(--white), -6px 0 0 0 var(--white), 0 6px 0 0 var(--white), 0 -6px 0 0 var(--white); transform: translate(var(--x), var(--y)); animation: mo-spark 1.2s steps(4) infinite; animation-delay: calc(var(--i) * 0.15s); }
@keyframes mo-spark { 0% { opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.mo-bm-title { font-size: var(--fl); color: var(--white); text-shadow: 3px 3px 0 var(--ink); }
.mo-bm-text { font-size: var(--fs); color: var(--cyan); }
.mo-bm-quote { font-family: var(--body); font-size: 13px; color: #d7ddef; max-width: 420px; line-height: 1.4; }
.mo-bm-quote b { font-family: var(--font); font-size: var(--fx); color: var(--yellow); font-weight: normal; }
.mo-bm-case { display: flex; gap: 6px; padding: 8px 10px; background: var(--ink); }
.mo-bm-new { animation: mo-blink 0.5s steps(2) 6; }

/* results of a ladder game */
.mo-res-line { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs); margin: 0 0 12px; padding: 8px 10px; background: var(--navy2); }
.mo-res-line.win { color: var(--yellow); }
.mo-res-line.loss { color: #c0c7d6; }

/* ---------- badge case ---------- */
.mo-badges { justify-content: safe center; }
.mo-case { background: #3a2416; padding: 0 16px 16px; width: min(100%, 720px);
  box-shadow: 0 -4px 0 0 #c89868, 0 4px 0 0 #c89868, -4px 0 0 0 #c89868, 4px 0 0 0 #c89868, 0 -8px 0 0 var(--ink), 0 8px 0 0 var(--ink), -8px 0 0 0 var(--ink), 8px 0 0 0 var(--ink), 8px 12px 0 0 var(--ink); }
.mo-case-lid { font-size: var(--fs); color: #f0d0a0; text-align: center; padding: 10px 0 12px; letter-spacing: 3px; }
.mo-case-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; background: #1d4a2a; padding: 14px; background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 6px); box-shadow: inset 0 4px 0 0 rgba(0, 0, 0, 0.35); }
.mo-sock { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; background: rgba(11, 13, 20, 0.35); }
.mo-sock-art { padding: 6px; background: #12301c; box-shadow: inset 2px 2px 0 0 rgba(0, 0, 0, 0.5); }
.mo-sock.won .mo-sock-art { background: #24543a; }
.mo-sock-name { font-size: var(--fx); color: #9aa6c8; }
.mo-sock.won .mo-sock-name { color: var(--yellow); }
.mo-sock-sub { font-size: var(--fx); color: #8d99ae; text-align: center; line-height: 1.4; }
.mo-sock-sub span { white-space: nowrap; }
.mo-sock.won .mo-sock-sub { color: #d7ddef; }
.mo-case-champ { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 10px 14px; background: rgba(11, 13, 20, 0.45); font-size: var(--fs); color: #9aa6c8; }
.mo-case-champ.won { color: var(--yellow); }
.mo-case-champ-t small { display: block; font-size: var(--fx); color: #d7ddef; margin-top: 6px; }
.mo-case-stats { font-size: var(--fx); color: #9aa6c8; margin-top: 16px; text-align: center; }

/* ---------- Hall of Fame ---------- */
.mo-hall { justify-content: safe center; }
.mo-gold-t { color: var(--yellow); text-shadow: 3px 3px 0 #b8860b, 6px 6px 0 var(--ink); }
.mo-hof { position: relative; width: min(100%, 1100px); background: var(--navy); padding: 12px 14px 14px; overflow: hidden;
  box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 0 -8px 0 0 var(--ink), 0 8px 0 0 var(--ink), -8px 0 0 0 var(--ink), 8px 0 0 0 var(--ink); }
.mo-hof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.mo-hof-cup { flex: none; animation: mo-bob 0.9s steps(2) infinite; }
.mo-hof-ttl { display: flex; flex-direction: column; gap: 6px; }
.mo-hof-kicker { font-size: var(--fx); color: var(--cyan); letter-spacing: 2px; }
.mo-hof-namerow { display: flex; align-items: center; gap: 10px; }
.mo-hof-team { font-size: var(--fl); color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }
.mo-hof-date { font-size: var(--fx); color: #9aa6c8; }
.mo-hof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(64px * var(--hs, 1) + 22px), 1fr)); gap: 6px 2px; }
.mo-hof-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; background: repeating-conic-gradient(#121a33 0 25%, #0f1630 0 50%) 0 0 / 8px 8px; }
.mo-hof-grid.induct .mo-hof-cell { animation: mo-induct 0.5s steps(4) both; animation-delay: calc(0.3s + var(--i) * 0.13s); }
@keyframes mo-induct { 0% { opacity: 0; transform: translateY(-12px); background: var(--white); } 50% { opacity: 1; background: var(--white); } 100% { opacity: 1; transform: none; } }
.mo-hof-name { font-family: var(--body); font-weight: 700; font-size: calc(7px + 4px * var(--hs, 1)); line-height: 1.15; color: var(--white); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the spot: cyan on the navy (a team color can be as dark as the panel), underlined in the team color */
.mo-hof-slot { font-size: var(--fx); line-height: 1; color: var(--cyan); padding-bottom: 2px; border-bottom: 2px solid var(--tc, var(--cyan)); }
.mo-hof-pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: var(--fx); color: #9aa6c8; }
.mo-hof-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-top: 10px; }
.mo-hof-empty-t { font-size: var(--fm); color: var(--yellow); }
.mo-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mo-confetti i { position: absolute; top: -10px; width: 6px; height: 6px; background: var(--c); animation: mo-fall 2.4s steps(12) both; animation-delay: var(--d); }
@keyframes mo-fall { 0% { transform: translateY(0); opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(560px) translateX(18px); opacity: 0; } }

/* ---------- in-game: the badge on the line ---------- */
.mo-ingame canvas { margin-right: 7px; }
.mo-ingame { position: absolute; left: calc(10px + var(--safe-l, 0px)); top: calc(8px + var(--safe-t, 0px)); display: flex; align-items: center; gap: 0; padding: 5px 8px 4px 6px; font-size: var(--fx); color: var(--white); background: var(--navy); border-left: 4px solid var(--tc); pointer-events: none; z-index: 2; box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), 2px 0 0 0 var(--line), 0 4px 0 0 var(--ink); }

/* ---------- landscape phones / short screens ---------- */
@media (max-height: 560px) {
  .screen.mo-screen { padding-top: calc(8px + var(--safe-t, 0px)); padding-bottom: calc(10px + var(--safe-b, 0px)); }
  .mo-screen > .stitle { margin-bottom: 8px; }
  .mo-panel { padding: 12px 16px; }
  .mo-lead { margin: -4px 0 8px; font-size: var(--fx); }
  .mo-steps { gap: 8px; margin-bottom: 8px; }
  .mo-step { padding: 6px; }
  .mo-step-art { height: 46px; }
  .mo-step-d { font-size: 10px; }
  .mo-step-t { margin: 4px 0; font-size: var(--fx); }
  .mo-current { margin-top: 6px; }
  .mo-dtop { margin-bottom: 6px; gap: 10px; }
  .mo-dround b, .mo-dovr b { font-size: var(--fl); margin: 1px 0; }
  .mo-dslot-tag { font-size: var(--fx); padding: 4px 6px 3px; }
  .mo-dslot-name { font-size: var(--fm); margin-top: 6px; }
  .mo-dcards { gap: 16px; }
  .mo-cfront { gap: 4px; padding-bottom: 6px; min-width: 168px; }
  .mo-chead { padding: 4px 6px 3px; border-bottom-width: 3px; }
  .mo-fit, .mo-stat { gap: 4px; }
  .mo-bar b { width: 5px; height: 6px; }
  .mo-bar.fit b { width: 6px; }
  .mo-stats { gap: 3px; }
  .mo-dbar { margin-top: 8px; gap: 10px; }
  .mo-dbar .pbtn { padding: 6px 9px 5px; font-size: var(--fx); }
  .mo-strip { margin-top: 6px; gap: 8px; }
  .mo-srow { gap: 2px; }
  .mo-sslot { padding: 2px; gap: 2px; }
  .mo-sgroup-t { display: none; }
  /* the formation and the team side by side (the side narrows) rather than stacked below the fold */
  .mo-done-body { gap: 14px; flex-wrap: nowrap; }
  .mo-done-side { gap: 7px; min-width: 0; }
  .mo-tname-t { font-size: var(--fm); }
  .mo-ovr-big b { font-size: var(--fl); }
  .mo-ovr-grade { font-size: var(--fl); }
  .mo-done-stars { display: none; }
  .mo-done-btns .pbtn { margin: 3px 0; }
  .mo-lhead { margin-bottom: 6px; }
  .mo-lhead .stitle { font-size: var(--fm); }
  .mo-lsub { display: none; }
  .mo-lbody { gap: 14px; }
  .mo-lside { gap: 8px; }
  .mo-gcard { padding: 8px 10px; gap: 5px; }
  .mo-gname { font-size: var(--fs); margin-bottom: 4px; }
  .mo-lteam { padding: 6px 8px; gap: 4px; }
  .mo-lteam-seg .pbtn { font-size: var(--fx); padding: 6px 7px 5px; margin: 2px 6px 2px 0; }
  .mo-lteam-heads { display: none; }
  .mo-lnav { margin-top: 8px; }
  .mo-vs { gap: 8px; }
  .mo-vs-side { padding: 8px 10px; gap: 4px; }
  .mo-vs-name { font-size: var(--fl); }
  .mo-vs-vs { font-size: var(--fh); }
  .mo-textbox { font-size: var(--fs); padding: 10px 14px 12px; min-height: 40px; }
  .mo-bm { gap: 5px; padding: 10px 14px; }
  .mo-bm-title { font-size: var(--fm); }
  .mo-bm-quote { font-size: 11px; }
  .mo-res-line { font-size: var(--fx); padding: 3px 6px; margin: -4px 0 4px; gap: 6px; }
  .mo-ing-full { display: none; }
  .mo-ingame { font-size: var(--fx); padding: 4px 6px 3px 4px; }
  .mo-case-grid { gap: 6px; padding: 8px; }
  .mo-sock { padding: 6px 2px; gap: 4px; }
  .mo-case-lid { padding: 6px 0 8px; }
  .mo-case-champ { margin-top: 6px; padding: 6px 10px; }
  .mo-case-stats { margin-top: 8px; }
  .mo-hof-grid { gap: 3px 2px; }
  .mo-hof-head { gap: 10px; margin-bottom: 6px; padding-bottom: 6px; }
  .mo-hof-team { font-size: var(--fm); }
  .mo-empty-art { height: 92px; }
  .cards.mo-three .team-card { width: min(270px, 31vw); }
}
/* phones under 380 px tall (Safari's bars, 360 px Androids; ui.js html.mini): the ladder, the badge moment and the
   badge case fit without a scroll */
@media (max-height: 379px) {
  /* the ladder: BADGE CASE / HALL OF FAME / BACK go under the map, beside the gym card, instead of below everything */
  .screen.mo-ladder { display: grid; grid-template-columns: auto auto; align-content: safe center; justify-content: center; column-gap: 14px; }
  .mo-ladder > .mo-lhead { grid-column: 1 / -1; }
  .mo-ladder > .mo-lbody { display: contents; }
  .mo-ladder .mo-lmap { grid-column: 1; grid-row: 2; justify-self: center; align-self: start; }
  .mo-ladder .mo-lside { grid-column: 2; grid-row: 2 / 4; align-self: start; }
  .mo-ladder > .mo-lnav { grid-column: 1; grid-row: 3; align-self: start; }
  .mo-bm { gap: 3px; padding-top: 8px; padding-bottom: 8px; }
  .mo-bm-text { display: none; } /* the title above already names the badge */
  .mo-bm-quote { max-width: min(560px, 84vw); }
  /* the case: all eight sockets in one row; a won badge keeps its score, the leader and city step aside */
  .mo-case-grid { grid-template-columns: repeat(8, 1fr); }
  .mo-sock-sub { font-size: 0; }
  .mo-sock-sub span { font-size: var(--fx); }
  .mo-sock:not(.won) .mo-sock-sub { display: none; }
}
@media (max-width: 700px) and (min-height: 561px) {
  .mo-steps { grid-template-columns: 1fr; }
  .mo-dcards { gap: 8px; }
  .mo-lbody { flex-direction: column; align-items: center; }
  .mo-lside { width: min(100%, 420px); }
  .mo-case-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (pointer: coarse) {
  .mo-dhint { display: none; }
}
