:root {
  --bg: #0b0d16; --panel: #151a2b; --panel2: #1d2440; --line: #2a3354; --text: #eef1fb; --muted: #9aa3c4;
  --accent: #ffcb3d; --red: #e8341c; --blue: #3a6ae8; --good: #3fbf6a; --bad: #e0504a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* Nunito (SIL Open Font License, web/fonts/OFL-Nunito.txt), served from the game itself: no request to Google */
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(/fonts/nunito-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Nunito, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
h1, h2, h3 { font-weight: 850; letter-spacing: -.005em; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: #1a1400; border-color: var(--accent); font-weight: 700; }
button.ghost { background: transparent; }
button.big { padding: 12px 26px; font-size: 16px; }
button.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
button.icon { min-width: 44px; padding: 6px 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
input, select { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
label { font-weight: 600; font-size: 13px; color: var(--muted); display: block; margin: 10px 0 6px; }
.gimmickrow label { display: inline; margin: 0; }
h1 { font-size: 26px; margin: 8px 0 12px; } h2 { font-size: 17px; margin: 22px 0 10px; }
.muted { color: var(--muted); font-weight: 400; font-size: .9em; }
.small { font-size: 12.5px; }
.err { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; } .wrap { flex-wrap: wrap; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; }
kbd { font: 600 11px/1 ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; background: var(--panel); }

.bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(11,13,22,.92); backdrop-filter: blur(6px); z-index: 20; }
.logo { width: 30px; height: 30px; border-radius: 7px; } .brand { font-size: 16px; }
.profile { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; }
.profile img { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; background: #262c44; }
main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 110px; }

.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* first visit */
.hero { max-width: 640px; margin: 4vh auto 0; text-align: center; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }
.card-panel { max-width: 640px; margin: 18px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.card-panel input { flex: 1; min-width: 180px; }
/* rooms */
.roomcode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: var(--accent); background: var(--panel2); padding: 2px 10px; border-radius: 10px; margin-left: 6px; }
.roomfmt { margin: 6px 0 12px; } .roomscore { font-weight: 800; font-size: 18px; }
.seats { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.seat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 150px; justify-content: center; }
.seat img.face { width: 64px; height: 64px; border-radius: 12px; background: #262c44; image-rendering: pixelated; }
.seat.empty { border-style: dashed; color: var(--muted); } .seat.you { border-color: var(--accent); }
.seat .st { font-size: 13px; font-weight: 800; } .seat .st.ready { color: var(--good); } .seat .st.off { color: var(--bad); }
.seats .vsmid { align-self: center; font-weight: 900; font-size: 22px; color: var(--muted); }
.roomme { max-width: none; margin: 14px 0; } .roomme .mons { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .roomme .mons img, .roomme .mons canvas { width: 48px; height: 48px; image-rendering: pixelated; }
#friend .sheet > .big { width: 100%; margin: 8px 0 14px; } #roomCodeIn { flex: 1; font-family: ui-monospace, Menlo, monospace; letter-spacing: .15em; text-transform: uppercase; }
@media (max-width: 520px) { .seats { grid-template-columns: 1fr 1fr; } .seats .vsmid { display: none; } }
/* tournaments */
#cupCodeIn { flex: 1; font-family: ui-monospace, Menlo, monospace; letter-spacing: .15em; text-transform: uppercase; } #cupNameIn { width: 100%; }
.cupopts { margin: 8px 0 16px; } .cupopts select { min-height: 44px; }
.cupplayers { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cuprulesform { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.cuprulesform summary { cursor: pointer; font-weight: 600; min-height: 32px; line-height: 32px; }
.cuprulesform .cupopts { margin: 8px 0; } .cupchecks { gap: 6px 16px; margin: 6px 0; } .cupchecks label { display: flex; align-items: center; gap: 6px; min-height: 32px; margin: 0; text-transform: none; letter-spacing: 0; font-size: .95em; color: var(--text); }
.cupchecks input { min-height: 0; height: 18px; width: 18px; margin: 0; flex: none; }
.crlabel { margin: 10px 0 4px; font-size: .9em; } .crlabel select { min-height: 36px; }
.chips { gap: 6px; } .chips button { padding: 4px 10px; min-height: 32px; border-radius: 999px; font-size: .85em; }
.chips button.on { background: var(--chip, var(--accent)); color: #111; border-color: transparent; }
.cuprules { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; } .cuprules span { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .85em; }
.cuprules span.rl { background: none; border: 0; padding-left: 0; color: var(--muted); }
.cupplayer { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.cupplayer img { width: 30px; height: 30px; border-radius: 8px; background: #262c44; image-rendering: pixelated; } .cupplayer.out { opacity: .45; } .cupplayer.you { border-color: var(--accent); }
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 14px; overflow-x: auto; padding: 6px 2px 14px; }
.bpart { margin: 16px 0 2px; font-size: 16px; } .dbracket .bpart:first-child { margin-top: 6px; }
.bround { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; } .bround h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bmatch { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; } .bmatch.mine { border-color: var(--accent); } .bmatch.live { border-color: var(--good); box-shadow: 0 0 0 2px rgba(63,191,106,.25); }
.bside { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13.5px; } .bside + .bside { border-top: 1px solid var(--line); }
.bside .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bside.win .nm { color: var(--accent); } .bside.lose { opacity: .5; } .bside .sc { font-weight: 900; font-variant-numeric: tabular-nums; }
.bnote { padding: 4px 10px 6px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; } .bnote button { min-height: 30px; padding: 2px 10px; font-size: 12.5px; }
.champ { text-align: center; padding: 16px; border-radius: 16px; margin: 8px 0 14px; background: linear-gradient(135deg, rgba(255,203,61,.22), rgba(21,26,43,.8)); border: 1px solid var(--accent); animation: popIn .4s cubic-bezier(.2,1.3,.4,1); }
.champ b { display: block; font-size: 26px; color: var(--accent); }
/* modes: ranked / unranked switch, practice levels */
#modes button[aria-selected=true] { color: var(--accent); background: var(--panel2); }
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.levels button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; }
.levels b { font-size: 20px; } .levels span { font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.modetag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
/* the channel: video cards, the NEW strip, the one-time prompt (plain links, open in a new tab) */
a.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); text-decoration: none; font-weight: 700; box-shadow: 0 3px 0 rgba(0,0,0,.38); transition: transform .13s cubic-bezier(.3,1.6,.5,1), box-shadow .12s, filter .12s; }
a.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.38); } @media (hover: hover) { a.btn:hover { transform: translateY(-1px); filter: brightness(1.08); } }
a.btn.ghost { background: transparent; box-shadow: none; } a.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
a.btn.yt-sub { background: #ff0033; border-color: #ff0033; color: #fff; box-shadow: 0 3px 0 #a3001f; } a.btn.yt-sub:active { box-shadow: 0 1px 0 #a3001f; }
a.btn.yt-sub svg rect { fill: #fff; } a.btn.yt-sub svg path { fill: #ff0033; }
.yticon { display: inline-flex; }
.ytcard { display: flex; gap: 14px; align-items: center; max-width: 640px; margin: 0 auto 24px; padding: 12px; border-radius: 16px; background: rgba(21,26,43,.84);
  border: 1px solid var(--line); backdrop-filter: blur(10px); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.ythumb { position: relative; flex: 0 0 auto; width: 200px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; display: block; }
.ythumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.ythumb:hover img { transform: scale(1.05); }
.ythumb .play { position: absolute; inset: 0; margin: auto; width: 44px; height: 32px; border-radius: 9px; background: rgba(255,0,51,.92); color: #fff; display: grid; place-items: center; font-size: 15px; }
.ytinfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ytinfo small { color: var(--accent); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.ytinfo b { font-size: 15.5px; line-height: 1.3; } .ytinfo p { margin: 0 0 4px; font-size: 13.5px; }
.ytcard.compact { max-width: 460px; margin: 6px auto 14px; } .ytcard.compact .ythumb { width: 150px; } .ytcard.compact .ytinfo b { font-size: 14px; }
@media (max-width: 520px) { .ytcard:not(.compact) { flex-direction: column; align-items: stretch; } .ytcard:not(.compact) .ythumb { width: 100%; } .ytcard.compact .ythumb { width: 120px; } }
.newstrip { margin: 4px 0 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,203,61,.45); background: linear-gradient(90deg, rgba(255,203,61,.12), rgba(21,26,43,.6)); }
.newhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; } .newhead .newvid { color: var(--accent); font-weight: 700; }
.newnames { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: thin; }
.newchip { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; min-height: 36px; padding: 2px 10px 2px 2px; font-size: 13px; font-weight: 700; }
.newchip img, .newchip canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.newtag { position: absolute; top: 5px; right: 6px; padding: 0 6px; border-radius: 6px; background: var(--accent); color: #1a1400; font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.feature { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,0,51,.4); background: rgba(255,0,51,.07); color: var(--text); text-decoration: none; font-size: 14px; }
.feature:hover { border-color: #ff0033; }
/* the small channel link (result card) */
.yt { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto 24px; padding: 12px 16px; border-radius: 14px; color: var(--text); text-decoration: none;
  background: rgba(21,26,43,.84); border: 1px solid var(--line); backdrop-filter: blur(10px); transition: transform .13s cubic-bezier(.3,1.6,.5,1), border-color .12s; }
.yt span { display: flex; flex-direction: column; } .yt small { color: var(--muted); font-size: 13px; }
.yt:hover { border-color: #ff0033; transform: translateY(-1px); } .yt:active { transform: translateY(1px); }
.yt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.yt.small { margin: 12px auto 0; padding: 6px 10px; gap: 8px; background: none; border-color: transparent; backdrop-filter: none; justify-content: center; font-size: 13.5px; }
.yt.small span { display: inline; }
.signin { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.signin p { margin: 0 0 10px; }
button.discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 700; }
button.google { background: #fff; border-color: #dadce0; color: #1f1f1f; font-weight: 700; }
.trainers { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding: 2px 2px 18px;
  scroll-snap-type: y mandatory; scroll-padding: 2px; -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); }
.trainers > * { scroll-snap-align: start; }
#profile .trainers { margin-bottom: 14px; }
.trainer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 11.5px; min-height: 0; }
.trainer img { width: 48px; height: 48px; image-rendering: pixelated; border-radius: 8px; background: #262c44; }
.trainer[aria-checked=true] { border-color: var(--accent); background: var(--panel2); box-shadow: 0 0 0 2px var(--accent) inset; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button[aria-selected=true] { background: var(--panel2); color: var(--accent); font-weight: 700; }
.standing { font-weight: 600; color: var(--muted); }

/* team */
.teamhead h2 { margin-bottom: 6px; }
.team { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.team li { background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; min-height: 110px; padding: 0; display: flex; }
.team li > button { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 8px 6px; cursor: pointer; border-radius: 12px; font-size: 12px; text-align: center; }
.team li > button:focus-visible { outline: 3px solid var(--accent); }
.team li.filled { border-style: solid; }
.team li.editing { border-color: var(--accent); background: var(--panel2); }
.team li.incomplete { border-color: var(--bad); }
.team li .empty { margin: auto; color: var(--muted); }
.team img, .card img, .team canvas, .card canvas { width: 56px; height: 56px; image-rendering: pixelated; object-fit: contain; }
.mon canvas { width: 36px; height: 36px; image-rendering: pixelated; } .saved .sprites canvas { width: 26px; height: 26px; } .searchteam canvas { width: 48px; height: 48px; } .imons canvas { width: clamp(24px, 4.4vw, 50px); height: clamp(24px, 4.4vw, 50px); }
.team li .nm { font-weight: 700; }
.team li .lead { color: var(--accent); font-size: 11px; }
.mlist { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.mlist .missing { color: var(--bad); font-weight: 600; }

.editor { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 10px; margin: 10px 0 4px; font-size: 12px; }
.stat b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; } .stat .sbar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 3px; } .stat .sbar i { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.movesorts { gap: 8px; margin-top: 10px; } .movesort button { padding: 6px 11px; min-height: 36px; }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-top: 10px; }
.pmove { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 10px; border-left: 5px solid var(--tc); text-align: left; min-height: 64px; }
.pmove .nm { font-weight: 700; font-size: 13.5px; } .pmove .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.pmove .meta > span { white-space: nowrap; } .pmove .meta .mt { font-weight: 700; color: var(--tc); }
.pmove .desc { font-size: 11.5px; color: #c4cbe4; line-height: 1.3; }
.pmove.on { background: color-mix(in srgb, var(--tc) 26%, var(--panel2)); border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc) inset; }
.pmove.on .nm::after { content: ' ✓'; color: var(--accent); }
.gimmickrow { margin-top: 14px; gap: 10px; }

/* roster */
.rosterhead { margin-top: 10px; } .rosterhead h2 { margin-bottom: 6px; }
#search { width: min(320px, 100%); }
.gens { flex-wrap: wrap; margin-bottom: 4px; } .gens button { padding: 8px 12px; min-height: 44px; }
section.gen h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 16px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 0; }
.card.on { border-color: var(--accent); background: var(--panel2); }
.card .num { position: absolute; top: 5px; left: 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .nm { font-weight: 600; font-size: 12.5px; }
.types { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.type { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--tc, #333c60); color: #fff; text-transform: uppercase; letter-spacing: .03em; text-shadow: 0 1px 1px rgba(0,0,0,.5); }
.badge { font-size: 11px; color: var(--accent); font-weight: 600; }

/* saved teams */
.savedlist { display: flex; gap: 8px; flex-wrap: wrap; }
.saved { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.saved.on { border-color: var(--accent); }
.saved button { border: 0; border-radius: 0; background: transparent; min-height: 54px; }
.saved .open { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px; }
.saved .open b { font-size: 13px; }
.saved .sprites { display: flex; } .saved .sprites img { width: 26px; height: 26px; image-rendering: pixelated; }
.saved .play { color: var(--accent); font-weight: 700; border-left: 1px solid var(--line); }
.saved .del { color: var(--muted); border-left: 1px solid var(--line); padding: 0 14px; }
.saved .del.sure { color: #fff; background: var(--bad); }
#saveBox input { min-height: 36px; padding: 6px 10px; width: 180px; }

/* the sticky action bar: why you can't battle yet, or the button */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 10px max(16px, calc((100vw - 1100px) / 2 + 16px)); background: rgba(16,20,36,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.actionbar .status { color: var(--muted); font-size: 14px; text-align: right; }
.actionbar .status.ready { color: var(--good); font-weight: 600; }

/* searching */
.ballspin { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(#e8341c 0 46%, #111 46% 54%, #f4f4f4 54%); box-shadow: 0 0 0 3px #111; position: relative; animation: wobble 1.2s ease-in-out infinite; }
.ballspin::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: #f4f4f4; box-shadow: 0 0 0 3px #111; }
/* the search radar: a sweeping ring and two pulses round the wobbling ball */
.radar { position: relative; width: 132px; height: 132px; display: grid; place-items: center; margin: 4px 0 6px; }
.radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(214,245,49,.55) 97%, #d6f531 100%); -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%); mask: radial-gradient(circle, transparent 58%, #000 59%); animation: sweep 1.6s linear infinite; }
.radar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(214,245,49,.18); }
.radar i { position: absolute; inset: 22%; border-radius: 50%; border: 2px solid #d6f531; opacity: 0; animation: ping 2.4s ease-out infinite; } .radar i + i { animation-delay: 1.2s; }
@keyframes sweep { to { transform: rotate(1turn); } } @keyframes ping { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }
#searchInfo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.schip { padding: 3px 12px; border-radius: 999px; background: var(--panel2); color: var(--text); font-size: 13px; }
.stime { flex-basis: 100%; font-size: 34px; font-variant-numeric: tabular-nums; color: var(--text); }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }
.searchteam { display: flex; gap: 4px; margin: 6px 0 10px; } .searchteam img { width: 48px; height: 48px; image-rendering: pixelated; }
.tip { max-width: 520px; color: #c4cbe4; min-height: 2.8em; }

/* battle */
.stage { position: relative; width: min(100%, calc((100dvh - 250px) * 16 / 9)); min-width: min(100%, 420px); margin: 0 auto; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.stage canvas { width: 100%; height: 100%; display: block; transition: filter .6s; }
.stage.dim canvas { filter: brightness(.5) saturate(.85); }
#controls, .mini, .rotate { width: min(100%, max(calc((100dvh - 250px) * 16 / 9), 420px)); margin-left: auto; margin-right: auto; }
.stagebar { display: flex; align-items: center; gap: 6px; min-height: 36px; margin: 0 auto 4px; width: min(100%, max(calc((100dvh - 250px) * 16 / 9), 420px)); }
.stagebar .icon { min-height: 32px; min-width: 36px; padding: 2px 8px; }
.youtag { padding: 3px 10px; border-radius: 6px; background: var(--accent); color: #1a1400; font-weight: 900; font-size: 12px; letter-spacing: .06em; }
.youtag.right { order: 3; margin-left: 6px; }
.youtag.watch { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.clock { position: absolute; left: 50%; top: 1.2%; transform: translateX(-50%); padding: 2px 12px; border-radius: 10px; background: #0b0d16; border: 1px solid #2a3354; font-weight: 800; font-variant-numeric: tabular-nums; font-size: clamp(11px, 1.4vw, 15px); pointer-events: none; }
.clock.sd { background: #4a1a10; border-color: var(--bad); }
.clock.warn { background: var(--bad); animation: pulse 1s infinite; }
/* weather and Tailwind in play, with seconds left (under the clock) */
.fieldfx { position: absolute; left: 50%; top: calc(1.2% + clamp(20px, 2.6vw, 28px)); transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.fieldfx span { padding: 1px 9px; border-radius: 9px; background: #0b0d16d9; border: 1px solid #2a3354; font-weight: 800; font-variant-numeric: tabular-nums; font-size: clamp(10px, 1.25vw, 14px); white-space: nowrap; }
.fieldfx span.low { opacity: .6; }
@keyframes pulse { 50% { opacity: .6; } }
.notice { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); padding: 6px 14px; border-radius: 10px; background: rgba(11,13,22,.85); border: 1px solid var(--accent); font-weight: 700; font-size: clamp(12px, 1.6vw, 16px); text-align: center; max-width: 90%; }
.moves { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; min-height: 60px; }
.move { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; border-left: 5px solid var(--tc, #888); min-height: 60px; }
.move .nm { font-weight: 700; font-size: 13.5px; position: relative; }
.move .meta { font-size: 11.5px; color: var(--muted); position: relative; text-transform: uppercase; letter-spacing: .03em; }
.move .cd { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.08); pointer-events: none; }
.move.ready.near { box-shadow: 0 0 0 2px var(--tc) inset, 0 0 14px -2px var(--tc); }
.move.called { box-shadow: 0 0 0 3px var(--accent) inset; }
.move.placeholder { border-left-color: var(--line); color: var(--muted); justify-content: center; }
.move:disabled { opacity: .55; }
.controls { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; flex-wrap: wrap; }
.bench { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; flex: 1; min-width: 0; }
.mon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; font-size: 12px; min-height: 66px; }
.mon img { width: 36px; height: 36px; image-rendering: pixelated; }
.mon.out { border-color: var(--accent); }
.mon.want { border-color: var(--good); box-shadow: 0 0 0 2px var(--good) inset; }
.bench.choosing .mon:not(:disabled) { animation: glow 1s infinite; border-color: var(--good); }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--good) inset; } }
.hp { width: 90%; height: 5px; background: #2a3354; border-radius: 3px; overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--good); }
.mega { position: relative; background: linear-gradient(135deg, #ff7ad9, #7ab8ff); color: #10132a; font-weight: 800; border: 0; min-width: 150px; }
.mega.want { box-shadow: 0 0 0 3px var(--accent); }
.mega.done { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.mega kbd { color: #10132a; border-color: rgba(16,19,42,.5); background: transparent; }
.mon kbd, .move kbd, .mega kbd { position: absolute; top: 4px; right: 6px; }
.note { min-height: 1.4em; margin: 6px 0 0; }
.mini { display: none; }
.rotate { text-align: center; color: var(--muted); font-size: 13px; }

/* the intro */
.vs.intro { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr auto; align-items: center; gap: 0 2vw; padding: 3% 4%;
  background: radial-gradient(ellipse at 25% 50%, rgba(232,52,28,.35), transparent 60%), radial-gradient(ellipse at 75% 50%, rgba(58,106,232,.35), transparent 60%), rgba(8,10,18,.95); }
.iformat { grid-column: 1 / -1; text-align: center; font-size: clamp(11px, 1.6vw, 15px); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); animation: fadeIn .4s both; }
.iside { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.iside.s0 { animation: inLeft .5s cubic-bezier(.2,.9,.3,1.1) both; } .iside.s1 { animation: inRight .5s cubic-bezier(.2,.9,.3,1.1) both; }
.iside .face { width: clamp(52px, 10vw, 116px); height: clamp(52px, 10vw, 116px); image-rendering: pixelated; border-radius: 14px; background: #262c44; border: 3px solid rgba(255,255,255,.2); object-fit: cover; }
.iside.s0 .face { border-color: rgba(232,52,28,.9); } .iside.s1 .face { border-color: rgba(58,106,232,.9); }
.iside .you { position: absolute; top: -4px; padding: 1px 7px; border-radius: 6px; background: var(--accent); color: #1a1400; font-weight: 900; font-size: clamp(9px, 1.2vw, 12px); letter-spacing: .08em; }
.iname { font-size: clamp(15px, 3vw, 30px); font-weight: 900; }
.istand { font-size: clamp(11px, 1.5vw, 15px); color: var(--muted); font-weight: 600; min-height: 1.2em; }
.imons { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 34vw; }
.imons img { width: clamp(24px, 4.4vw, 50px); height: clamp(24px, 4.4vw, 50px); image-rendering: pixelated; animation: fadeIn .3s both; }
.imons .ball { width: clamp(15px, 2.3vw, 25px); height: clamp(15px, 2.3vw, 25px); margin: 3px; border-radius: 50%; background: linear-gradient(#e8341c 0 45%, #111 45% 55%, #f4f4f4 55%); box-shadow: 0 0 0 2px #111; }
.vsmark { font-size: clamp(34px, 9vw, 108px); font-weight: 900; font-style: italic; color: var(--accent); text-shadow: 0 0 30px rgba(255,203,61,.6), 4px 4px 0 #000; animation: slam .45s .35s cubic-bezier(.3,1.6,.4,1) both; }
.icount { grid-column: 1 / -1; text-align: center; font-size: clamp(30px, 7vw, 78px); font-weight: 900; line-height: 1.1; padding-bottom: 2%; color: #fff; text-shadow: 0 3px 0 #000; }
.icount.beat { animation: beat .5s ease-out; }
@keyframes inLeft { from { opacity: 0; transform: translateX(-30%); } } @keyframes inRight { from { opacity: 0; transform: translateX(30%); } }
@keyframes slam { from { opacity: 0; transform: scale(3) rotate(-8deg); } } @keyframes fadeIn { from { opacity: 0; } }
@keyframes beat { from { transform: scale(1.8); opacity: .3; } }

/* the end card: fixed over the page, lower than the battle's "WINS!" banner */
.endcard { position: fixed; left: 50%; top: 58%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; z-index: 30;
  background: #10141f; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; text-align: center; animation: cardIn .45s cubic-bezier(.2, .9, .3, 1.2); box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.endcard h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 2px; letter-spacing: .02em; }
.endcard.won h1 { color: var(--accent); text-shadow: 0 0 24px rgba(255, 203, 61, .45); }
.endcard.lost h1 { color: #c9d0ea; }
.endcard p { margin: 0 0 10px; min-height: 1em; }
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, -40%) scale(.92); } }
.rating { background: var(--panel); border-radius: 12px; padding: 12px; margin: 6px 0 14px; text-align: left; }
.rrow { display: flex; align-items: baseline; gap: 8px; }
.rrow b { font-size: 30px; font-variant-numeric: tabular-nums; }
.tier { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: #2a3354; }
/* the ranks (web/ranks.js): each tier in its ball's colours */
.tier[data-tier="Beginner"] { background: #5b6478; } .tier[data-tier="Poké Ball"] { background: #d8332a; } .tier[data-tier="Great Ball"] { background: #2f6fe0; }
.tier[data-tier="Ultra Ball"] { background: #1d1f26; color: #ffd84a; box-shadow: inset 0 -3px 0 #e8b81c; } .tier[data-tier="Master Ball"] { background: #7b3ad0; }
.tier[data-tier="Champion"] { background: linear-gradient(90deg, #f4c94a, #fff1a8, #f4c94a); color: #1a1400; }
.table .tier { font-size: 11.5px; padding: 2px 7px; margin-right: 4px; }
.delta { font-weight: 800; font-size: 18px; animation: pop .5s .2s both; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.rbar { height: 10px; background: #2a3354; border-radius: 6px; overflow: hidden; margin-top: 8px; } .rbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffe58a); }
.endcard.lost .rbar i { background: linear-gradient(90deg, #6b7590, #9aa4c4); }
.rfoot { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .rfoot .small { margin-left: auto; }
.dots { display: flex; gap: 6px; } .dots i { width: 14px; height: 14px; border-radius: 50%; background: #2a3354; } .dots i.on { background: var(--accent); }
.news { min-height: 1.4em; margin-top: 8px; font-weight: 800; color: var(--accent); }
.news.pop { animation: pop .6s cubic-bezier(.2, .9, .3, 1.6); }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
.center-row { justify-content: center; flex-wrap: wrap; }
.muted-in { font-weight: 500; opacity: .7; font-size: 12px; margin-left: 4px; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(5,6,12,.7); padding: 12px; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.helplist { padding-left: 18px; } .helplist li { margin: 8px 0; color: #d2d8ee; }
.helpsub { font-size: 17px; margin: 18px 0 4px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; background: #232b4d; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 16px; font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }

.table { width: 100%; border-collapse: collapse; } .table td, .table th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table tr.you td { background: rgba(255, 203, 61, .12); font-weight: 700; }
.table td img { width: 28px; height: 28px; image-rendering: pixelated; vertical-align: middle; border-radius: 6px; background: #262c44; margin-right: 8px; }

/* phones held upright: battle edge to edge, a readable mini HUD, big tap targets */
@media (max-width: 700px) {
  main { padding: 8px 10px 110px; }
  .team { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #battle { margin: 0 -10px; }
  .stage { border-radius: 0; width: 100%; min-width: 0; }
  #controls, .rotate { padding: 0 10px; }
  .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px 0; width: 100%; }
  .mini .side { background: var(--panel); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
  .mini .side.you { border: 1px solid var(--accent); }
  .mini .nm { font-weight: 800; display: flex; justify-content: space-between; gap: 6px; } .mini .hp { width: 100%; height: 8px; margin-top: 4px; }
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls { flex-direction: column; }
  .mega { width: 100%; min-height: 50px; }
  .mon kbd, .move kbd, .mega kbd { display: none; }
  .actionbar { justify-content: space-between; }
  .actionbar .status { text-align: left; }
}
@media (max-width: 380px) { .roster { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }

/* the battle gets the whole window: no page header (help and sound sit in the bar over the arena) */
body[data-screen=battle] .bar { display: none; }
body[data-screen=battle] main { padding-top: 6px; }
.choose { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 22px; border-radius: 14px; background: rgba(11,13,22,.9); border: 2px solid var(--good);
  font-weight: 900; font-size: clamp(15px, 2.6vw, 26px); text-align: center; box-shadow: 0 0 30px rgba(63,191,106,.35); animation: cardIn .25s both; }
.choose small { display: block; font-size: .6em; color: var(--muted); font-weight: 600; margin-top: 2px; }
.reconnect { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(8,10,18,.92); font-weight: 700; }
.away { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; margin: 10px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mega.waiting { background: linear-gradient(135deg, rgba(255,122,217,.35), rgba(122,184,255,.35)); color: var(--text); }
.saved-ok { color: var(--good); font-size: 13px; font-weight: 600; }
@media (hover: none) { .keys { display: none; } }
/* type labels: dark text on the light types */
.type.light { color: #1a1400; text-shadow: none; }
@media (max-width: 700px) {
  .stagebar { padding: 0 10px; width: 100%; }
  .brand { display: none; }
  .actionbar button { white-space: nowrap; }
}
/* phones held sideways: arena and controls side by side would be cramped; keep them stacked but squeezed to fit */
@media (max-height: 500px) and (orientation: landscape) {
  .stagebar { display: none; }
  .stage, #controls, .mini { width: min(100%, calc((100dvh - 128px) * 16 / 9)); }
  .mini { display: none !important; }
  .moves { margin-top: 4px; min-height: 0; } .move { min-height: 44px; padding: 4px 8px; } .move .meta { display: none; }
  .controls { margin-top: 4px; flex-direction: row; flex-wrap: nowrap; } .bench { flex: 1; }
  .mon { min-height: 44px; padding: 2px 4px; gap: 2px; } .mon > span { display: none; } .mon img, .mon canvas { width: 28px; height: 28px; }
  .mega { min-width: 110px; width: auto; min-height: 44px; } .note { display: none; }
  .bench { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
}

.abilities { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 2px; font-size: 13px; }
.abil b { margin-right: 6px; } .abil span { color: #c4cbe4; } .abil span.muted { color: var(--muted); }


/* ---------------------------------------------------------------- the live arena behind the menus (backdrop.js) */
#backdrop { position: fixed; left: 0; top: 0; z-index: 0; opacity: 0; pointer-events: none; image-rendering: pixelated;
  filter: brightness(.78) saturate(1.05); transition: opacity 1.1s ease; }   /* sized and placed by backdrop.js (the court only) */
#backdrop.on { opacity: var(--bd, 1); }
.backshade { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(11,13,22,.05), rgba(11,13,22,.55) 80%), linear-gradient(180deg, rgba(11,13,22,.6), rgba(11,13,22,.15) 30%, rgba(11,13,22,.15) 62%, rgba(11,13,22,.85)); }
main { position: relative; z-index: 1; }
body[data-screen=builder], body[data-screen=board] { --bd: .4; }
body[data-screen=battle] #backdrop, body[data-screen=battle] .backshade { display: none; }
.hero h1, .hero p, #searching h1, #elsewhere p { text-shadow: 0 2px 16px rgba(0,0,0,.65); }
#welcome .card-panel, #searching .searchteam, #elsewhere > *, #board .table { backdrop-filter: blur(10px) saturate(1.15); }
#welcome .card-panel { background: rgba(21,26,43,.84); box-shadow: 0 22px 60px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------- buttons you can feel: they lift, and press down */
button { transition: transform .13s cubic-bezier(.3,1.6,.5,1), box-shadow .12s ease, filter .12s ease, background .12s ease; box-shadow: 0 3px 0 rgba(0,0,0,.38); }
@media (hover: hover) { button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); } }
button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.38); filter: brightness(.97); }
button.primary { background: linear-gradient(#ffd965, #ffc21f); box-shadow: 0 4px 0 #a97d0c, 0 8px 22px rgba(255,203,61,.2); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
button.primary:not(:disabled):active { box-shadow: 0 1px 0 #a97d0c, 0 3px 10px rgba(255,203,61,.15); }
button.big { font-weight: 850; letter-spacing: .01em; }
button.discord { box-shadow: 0 4px 0 #3c45a8; } button.discord:not(:disabled):active { box-shadow: 0 1px 0 #3c45a8; }
button.google { box-shadow: 0 4px 0 #9aa0a6; } button.google:not(:disabled):active { box-shadow: 0 1px 0 #9aa0a6; }
button.ghost, .seg button, .saved button, button:disabled { box-shadow: none; }
button.ghost:not(:disabled):active { box-shadow: none; }

/* ---------------------------------------------------------------- motion: a few shared moves, used everywhere */
@keyframes screenIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes slideOver { from { opacity: 0; transform: translateX(-34px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(14px); } }
@keyframes arrive { 0% { opacity: 0; transform: scale(.55); } 70% { transform: scale(1.06); } }
@keyframes shake { 20% { translate: -7px; } 40% { translate: 6px; } 60% { translate: -4px; } 80% { translate: 2px; } }
@keyframes float { 50% { transform: translateY(-3px); } }
/* a screen coming in fades, then its parts rise in one after another (show() in app.js adds .entering) */
.screen.entering:not(#battle) { animation: screenIn .25s ease-out; }
.screen.entering:not(#battle) > * { animation: riseIn .45s cubic-bezier(.2,1.25,.4,1) backwards; }
.screen.entering:not(#battle) > :nth-child(2) { animation-delay: 0.045s; }
.screen.entering:not(#battle) > :nth-child(3) { animation-delay: 0.090s; }
.screen.entering:not(#battle) > :nth-child(4) { animation-delay: 0.135s; }
.screen.entering:not(#battle) > :nth-child(5) { animation-delay: 0.180s; }
.screen.entering:not(#battle) > :nth-child(6) { animation-delay: 0.225s; }
.screen.entering:not(#battle) > :nth-child(7) { animation-delay: 0.270s; }
.screen.entering:not(#battle) > :nth-child(8) { animation-delay: 0.315s; }
.screen.entering:not(#battle) > :nth-child(9) { animation-delay: 0.360s; }
#welcome.entering .card-panel { animation: slideOver .55s cubic-bezier(.2,1.3,.4,1) .14s backwards; }
.screen.entering .actionbar { animation: riseIn .5s cubic-bezier(.2,1.25,.4,1) .2s backwards; }
.screen.entering .roster .card:nth-child(1) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.145s backwards; }
.screen.entering .roster .card:nth-child(2) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.170s backwards; }
.screen.entering .roster .card:nth-child(3) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.195s backwards; }
.screen.entering .roster .card:nth-child(4) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.220s backwards; }
.screen.entering .roster .card:nth-child(5) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.245s backwards; }
.screen.entering .roster .card:nth-child(6) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.270s backwards; }
.screen.entering .roster .card:nth-child(7) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.295s backwards; }
.screen.entering .roster .card:nth-child(8) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.320s backwards; }
.screen.entering .roster .card:nth-child(9) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.345s backwards; }
.screen.entering .roster .card:nth-child(10) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.370s backwards; }
.screen.entering .roster .card:nth-child(11) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.395s backwards; }
.screen.entering .roster .card:nth-child(12) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.420s backwards; }
.screen.entering .roster .card:nth-child(13) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.445s backwards; }
.screen.entering .roster .card:nth-child(14) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.470s backwards; }
.screen.entering .roster .card:nth-child(15) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.495s backwards; }
.screen.entering .roster .card:nth-child(16) { animation: riseIn .4s cubic-bezier(.2,1.25,.4,1) 0.520s backwards; }
.modal:not([hidden]) { animation: screenIn .15s ease-out; }
.modal:not([hidden]) .sheet { animation: popIn .22s cubic-bezier(.2,1.3,.4,1); }
.toast:not([hidden]) { animation: popIn .2s cubic-bezier(.2,1.3,.4,1); }
.team li.arrive { animation: arrive .38s cubic-bezier(.2,1.4,.4,1); }
.shake { animation: shake .35s ease; }
.bar .logo { animation: float 3.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* the wordmark (each look styles it) */
.wordmark { display: inline-flex; align-items: baseline; gap: .25em; font-size: clamp(44px, 9vw, 84px); line-height: .95; margin: 0 0 10px; }
.wm-pb { color: #fff; background: var(--red); padding: 0 .18em; border-radius: .12em; } .wm-ranked { color: var(--text); }
.tagline { font-size: clamp(16px, 2.2vw, 20px); color: var(--text); margin: 0; }
/* more ways to play: one row (a scrolling strip on phones) */
.playnav { display: flex; gap: 8px; margin: 10px 0 4px; overflow-x: auto; scrollbar-width: none; } .playnav::-webkit-scrollbar { display: none; }
.playnav button { flex: 0 0 auto; white-space: nowrap; }
/* in three labelled groups (Play, Community, Stats), side by side as space allows */
.playnav { column-gap: 22px; row-gap: 10px; align-items: center; }
.navgroup { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.navlbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #8f94a1); }
/* ...but with a mouse a hidden sideways strip can't be scrolled (players never found Usage stats at its end): it wraps */
@media (hover: hover) and (pointer: fine) { .playnav { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } .navgroup { flex-wrap: wrap; } }
@media (max-width: 700px) {
  .gens { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; } .gens::-webkit-scrollbar { display: none; } .gens button { flex: 0 0 auto; }
  .playnav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
.newnames { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.types { flex-wrap: nowrap; }
.feature svg, .yt svg { flex: 0 0 auto; }
body[data-screen=searching] { --bd: .45; }

/* the footer: privacy, terms, the fan-game line (hidden in battles; above the builder's action bar) */
.legal { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 16px 120px; font-size: 12.5px; color: var(--muted); text-align: center; }
.legal a { color: var(--muted); } body[data-screen=battle] .legal { display: none; }

/* the team bar under the header while the team is out of view */
.teammini { position: fixed; left: 0; right: 0; top: var(--barH, 61px); z-index: 18; display: flex; align-items: center; gap: 12px; min-height: 52px; border-radius: 0;
  padding: 6px max(16px, calc((100vw - 1100px) / 2 + 16px)); background: rgba(11,13,22,.94); backdrop-filter: blur(8px); border: 0; border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px rgba(0,0,0,.35); animation: slideDown .22s ease-out; }
.teammini b { white-space: nowrap; font-size: 14px; } .teammini .slots { display: flex; gap: 6px; }
.teammini .slot { width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); }
.teammini .slot img, .teammini .slot canvas { width: 36px; height: 36px; image-rendering: pixelated; }
.teammini .slot.empty { background: transparent; outline: 1px dashed var(--line); outline-offset: -1px; }
.teammini .slot.arrive { animation: arrive .38s cubic-bezier(.2,1.4,.4,1); }
.teammini .why { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .teammini .why.ok { color: var(--good); font-weight: 700; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } }
@media (max-width: 520px) { .teammini { gap: 8px; } .teammini .slot { width: 34px; height: 34px; } .teammini .slot img, .teammini .slot canvas { width: 30px; height: 30px; } .teammini .why { display: none; } .teammini b { font-size: 13px; } }

/* usage tier badges on the builder's Pokémon (OU / UU / RU; the /usage page explains them) */
.tiertag { position: absolute; top: 5px; right: 6px; padding: 0 6px; font-size: 10px; font-weight: 900; letter-spacing: .05em; color: #fff; background: #3a4060; }
.tiertag.t-OU { background: #e3262f; } .tiertag.t-UU { background: #8a5cf6; } .tiertag.t-RU { background: #2f6bff; }
.tiertag ~ .newtag { top: 24px; }
/* win stars (app.js starsOn): top right; the usage tag and NEW move down under them */
.wstars { position: absolute; top: 3px; right: 5px; font-size: 13px; line-height: 1; letter-spacing: -1px; color: #ffd24a; text-shadow: 0 0 4px #000, 0 1px 0 #7a5a0a; pointer-events: none; z-index: 1; }
.wstars.s2 { color: #ffe27a; } .wstars.s3 { color: #fff1a8; text-shadow: 0 0 6px #ffd24a, 0 0 2px #000, 0 1px 0 #7a5a0a; }
.starred { position: relative; } .starred .tiertag { top: 20px; } .starred .newtag { top: 20px; } .starred .tiertag ~ .newtag { top: 39px; }

/* sign-in at the top of the welcome card */
.signin.top { margin: 0 0 14px; padding: 0 0 14px; border-top: 0; border-bottom: 1px solid var(--line); }
.signin.top p { color: var(--text); font-weight: 600; }
.newhere { margin: 0 0 10px; font-size: 13.5px; }

.fullnote { color: var(--accent); font-weight: 700; margin: 4px 0 8px; }
#searching .searchmain, #searching .searchside { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
/* a wide, short window (Discord 2026-11-03, Hajamaz: 'cut off at the bottom'): the search beside Higher or Lower, Cancel
   under the search, so the whole screen fits without scrolling */
@media (min-width: 900px) and (max-height: 940px) {
  #searching { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "main side" "cancel side";
    column-gap: 40px; align-content: center; justify-items: center; min-height: calc(100vh - 200px); }
  #searching .searchmain { grid-area: main; align-self: end; }
  #searching .searchside { grid-area: side; align-self: center; }
  #searching #cancelBtn { grid-area: cancel; align-self: start; margin-top: 4px; }
  #searching .radar { width: 104px; height: 104px; }
  #searching .searchside .gridcta { margin-top: 0; }
}

/* friends */
.badgecount { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; font-style: normal; }
.badgecount.off { background: var(--panel2); color: var(--muted); font-weight: 700; }   /* (a mode closed for now: Battle Royale) */
.friendslist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 50vh; overflow: auto; }
.friend { display: flex; align-items: center; gap: 10px; background: var(--panel2); padding: 6px 8px; }
.friend img { width: 36px; height: 36px; image-rendering: pixelated; } .friend .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friend .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .friend .st { font-size: 12.5px; color: var(--muted); }
.friend .st.online::before { content: '● '; color: var(--good); } .friend .st.battling::before { content: '● '; color: var(--accent); }
.friend .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sheet.invite { text-align: center; }

/* surrender (two taps) */
.surrender.arm { color: var(--bad); border-color: var(--bad); font-weight: 800; }
/* a replay's controls, under the arena */
.replaybar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px auto 0; width: min(100%, max(calc((100dvh - 250px) * 16 / 9), 420px)); }
.replaybar .seg button { min-height: 36px; padding: 4px 12px; } .replaybar .seg button[aria-pressed=true] { background: var(--panel2); color: var(--accent); font-weight: 800; }
.replaybar .rptrack { flex: 1; min-width: 80px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.replaybar .rptrack i { display: block; height: 100%; width: 0; background: var(--accent); }
.replaybar #rpTime { font-variant-numeric: tabular-nums; min-width: 82px; }
@media (max-width: 700px) { .replaybar { padding: 0 10px; } .replaybar .rptrack { order: 9; flex-basis: 100%; } }
/* recent battles */
.historylist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 55vh; overflow: auto; }
.hrow { display: flex; align-items: center; gap: 10px; background: var(--panel2); padding: 6px 8px; border-left: 3px solid var(--bad); }
.hrow.won { border-left-color: var(--good); }
.hrow img { width: 36px; height: 36px; image-rendering: pixelated; } .hrow .hinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hrow .hinfo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow button { min-height: 36px; padding: 4px 14px; }

/* double battles: a row per spot (who is in it, where it aims, its moves) */
#moves.dbl { display: flex; flex-direction: column; gap: 8px; }
.spotrow { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: 10px; }
.spotrow.picked { border-color: var(--accent); }
.spotrow .moves { margin-top: 0; min-height: 0; }
.spothead { display: flex; align-items: center; gap: 8px; }
.spothead .spotname { flex: 1; min-height: 34px; padding: 4px 10px; text-align: left; font-weight: 800; background: transparent; border: 0; }
.spothead .aim { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.spothead .aim.set { color: var(--accent); border-color: var(--accent); }
.mon[data-spot]:not([data-spot=""])::after { content: attr(data-spot); position: absolute; top: 2px; right: 4px; font-size: 12px; color: var(--accent); font-weight: 900; }
.mon { position: relative; }
.ifaces { display: flex; gap: 6px; justify-content: center; }
.mini .side .nm + .hp + .nm { margin-top: 4px; }
.fmtnote { margin: 4px 0 0; }
@media (max-width: 700px) {
  #moves.dbl { gap: 4px; }
  #moves.dbl .spotrow { padding: 2px; gap: 2px; }
  #moves.dbl .moves { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  #moves.dbl .move { min-height: 46px; padding: 4px 6px; border-left-width: 4px; }
  #moves.dbl .move .meta, #moves.dbl .move kbd { display: none; }
  #moves.dbl .move .nm { font-size: 12px; line-height: 1.15; }
  .spothead .spotname { min-height: 30px; font-size: 14px; }
  .spothead .aim { min-height: 30px; font-size: 11.5px; }
}
/* full screen (phones): a small button in the arena's corner; in full screen the battle screen fills it, scrolling if it must */
/* someone watching a live battle has no move buttons under the arena: the arena takes that room too (Discord 2026-11-07:
   "gotta get rid of this padding when viewing"); only the slim bar above it is kept - and on a phone held sideways not even that */
body.watching .stage { width: min(100%, calc((100dvh - 60px) * 16 / 9)); }
body.watching .stagebar, body.watching .mini { width: min(100%, max(calc((100dvh - 60px) * 16 / 9), 420px)); }
@media (max-height: 500px) and (orientation: landscape) { body.watching .stage, body.watching .mini { width: min(100%, calc((100dvh - 12px) * 16 / 9)); } }
body.watching main { max-width: none; }   /* (a big screen: not held to the page's 1100 px) */
/* ...and full screen is the arena alone, edge to edge, centred; ✕ / Esc and Leave sit on the arena */
html:fullscreen body.watching main { padding: 0; }
html:fullscreen body.watching .stagebar, html:fullscreen body.watching .mini { display: none; }
html:fullscreen body.watching .stage { width: min(100vw, calc(100dvh * 16 / 9)); min-width: 0; border-radius: 0; margin-top: max(0px, calc((100dvh - 100vw * 9 / 16) / 2)); }
/* a player in full screen (Discord 2026-11-08, Akumi: "Full-screen isn't full-screen", on a PC monitor a small box in the
   middle of a black screen): not held to 1100 px either, and the arena as tall as the screen less the bar above it and the
   move buttons under it (--fsbelow, measured by app.js fitFull; 250 px until then). Phones held sideways keep their own rules. */
@media not all and (max-height: 500px) and (orientation: landscape) {
  html:fullscreen body[data-screen=battle]:not(.watching):not(.tallplay) main { max-width: none; padding-bottom: 0; }
  html:fullscreen body[data-screen=battle]:not(.watching):not(.tallplay) .stage { width: min(100%, calc((100dvh - var(--fsbelow, 250px)) * 16 / 9)); }
  html:fullscreen body[data-screen=battle]:not(.watching):not(.tallplay) :is(#controls, .mini, .stagebar, .replaybar) { width: min(100%, max(calc((100dvh - var(--fsbelow, 250px)) * 16 / 9), 420px)); }
}
/* someone watching a live battle (a tournament's Watch, a room's spectators): the way out, on the arena itself - the bar above
   it is hidden on phones held sideways (Discord 2026-11-07: "no way to leave the Spectate on mobile") */
.fsbtn.leavebtn { right: auto; left: 6px; font-size: 14px; font-weight: 800; }
.fsbtn { position: absolute; right: 6px; bottom: 6px; z-index: 3; min-height: 34px; min-width: 34px; padding: 0 8px; font-size: 18px; line-height: 1; background: rgba(11,13,22,.6); border-color: rgba(255,255,255,.25); }
html:fullscreen { background: var(--bg); overflow: auto; }
/* manual control: the Auto / Manual switch and the thumb stick on the arena */
.manual { min-width: 110px; font-weight: 800; }
.manual.on { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.stage.steering { touch-action: none; cursor: crosshair; }
.stick { position: absolute; z-index: 4; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(11,13,22,.25); pointer-events: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(255,203,61,.85); }
/* the dodge button (manual control): the fill drains while it cools down */
.dodge { position: relative; overflow: hidden; min-width: 96px; font-weight: 900; border-color: var(--accent); }
.dodge::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--cd, 0%); background: rgba(255,255,255,.12); pointer-events: none; }
.dodge.cooling { color: var(--muted); }
.icount.wait { font-size: clamp(16px, 3vw, 30px); padding-top: 2%; }

/* challenges (server/challenges.mjs) */
.chbox { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; margin: 10px 0; }
.chhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .chhead .stars { color: var(--accent); font-weight: 800; }
.chcols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 6px; }
@media (max-width: 700px) { .chcols { grid-template-columns: 1fr; } }
.chsub { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0; }
.ch { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.ch .cnt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.ch .prog { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; } .ch .prog i { display: block; height: 100%; background: var(--accent); }
.ch.weekly .prog i { background: #7ab8ff; } .ch.done .txt { color: var(--muted); text-decoration: line-through; } .ch.done .cnt { color: var(--good); font-weight: 900; }
/* season emblems and titles */
.emblem { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; margin-left: 6px; } .emblem svg { width: 100%; height: 100%; display: block; }
.emblem.big { width: 34px; height: 34px; margin: 0; }
.ptitle { margin-left: 6px; font-size: 11.5px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.trophies { margin: 8px 0; } .emblems { display: flex; flex-wrap: wrap; gap: 10px; } .emb { display: flex; align-items: center; gap: 6px; } .emb .small { white-space: pre-line; line-height: 1.2; }
.iname .emblem { width: .8em; height: .8em; }
.chhead { width: 100%; background: none; border: 0; padding: 0; min-height: 0; text-align: left; cursor: pointer; }
.chhead .grow { flex: 1; } .chhead .chev { color: var(--muted); font-size: 14px; }
.chhead { text-transform: none; font-style: normal; clip-path: none; box-shadow: none; display: flex; align-items: baseline; gap: 12px; }
/* looks (web/cosmetics.js): pickers in the trainer panel, frames, effects */
.chroad { margin: 2px 0 4px; }
.looks { margin: 6px 0 10px; } .lookrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; } .lookrow .lk { width: 110px; font-size: 12.5px; color: var(--muted); }
.lookopt { position: relative; min-height: 0; padding: 3px; border-radius: 8px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.lookopt.on { outline: 2px solid var(--accent); } .lookopt.locked { opacity: .45; } .lookopt .req, .trainer .req { font-size: 10px; color: var(--muted); }
.swatch { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 16px; color: var(--accent); } .swatch.ball svg { width: 26px; height: 26px; }
.swatch.frame { box-shadow: inset 0 0 0 4px var(--panel); }
.roadbar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; } .roadbar i { display: block; height: 100%; background: var(--accent); }
.trainer.locked img { filter: grayscale(1) brightness(.6); }
img.framed { outline: 3px solid transparent; border-radius: 6px; box-shadow: 0 0 0 3px var(--frame); }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx.w-confetti i { position: absolute; top: -10px; left: var(--x); width: 7px; height: 11px; background: hsl(var(--h) 90% 60%); animation: confetti 2.6s var(--d) ease-in forwards; }
@keyframes confetti { to { transform: translateY(420px) rotate(540deg); opacity: 0; } }
.fx.w-stars i { position: absolute; top: 10%; left: var(--x); width: 3px; height: 3px; background: #fff; box-shadow: 0 0 8px 2px #ffe58a; animation: shoot 1.6s var(--d) ease-out forwards; }
@keyframes shoot { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-160px, 160px); opacity: 0; } }
.fx.w-fireworks i { position: absolute; top: 30%; left: var(--x); width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 0 hsl(var(--h) 90% 60%); animation: burst 1.4s var(--d) ease-out 2 forwards; }
@keyframes burst { to { box-shadow: 0 0 0 60px transparent, 30px -30px 0 2px hsl(var(--h) 90% 60%), -30px -30px 0 2px hsl(var(--h) 90% 70%), 30px 30px 0 2px hsl(var(--h) 90% 60%), -30px 30px 0 2px hsl(var(--h) 90% 70%); opacity: 0; } }
.fx.crown { inset: auto; top: -34px; left: 50%; transform: translateX(-50%); font-size: 40px; color: #f4c94a; text-shadow: 0 2px 0 #000; animation: crown .6s ease-out; }
@keyframes crown { from { transform: translate(-50%, -20px); opacity: 0; } }
/* Pokémon mastery: a frame in the tier's colour, the tier's name in the corner */
.mastered { box-shadow: inset 0 0 0 2px var(--mastery), 0 0 10px -3px var(--mastery) !important; position: relative; }
.mastered::after { content: attr(data-mastery); position: absolute; left: 4px; bottom: 3px; font-size: 9.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--mastery); pointer-events: none; }
.mastered[data-mastery=Master] { box-shadow: inset 0 0 0 2px var(--mastery), 0 0 14px -2px var(--mastery), 0 0 0 1px #fff3 !important; }
/* the fixed steering pad (phones held sideways, Manual) */
.pad { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: 22px; width: 128px; height: 128px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); z-index: 20; touch-action: none; }
.pad i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,203,61,.85); }
body.thumbs #guardBtn { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: 150px; width: 84px; height: 84px; min-width: 0; border-radius: 50%; clip-path: none; z-index: 20; background: rgba(150,210,255,.18); }
.guard { border-color: #96d2ff; }
body.thumbs #dodgeBtn { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: 34px; width: 104px; height: 104px; min-width: 0; border-radius: 50%; clip-path: none; z-index: 20; background: rgba(255,203,61,.18); }
/* the trophy room */
.trophyhead { display: flex; align-items: center; gap: 22px; margin: 10px 0 16px; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--bg) 78%, transparent 79%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.ring b { font-size: 26px; font-variant-numeric: tabular-nums; }
.tgroup h3 { margin: 18px 0 8px; } .tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tcard { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 8px 10px; } .tcard.maxed { border-color: var(--accent); }
.medal { width: 44px; height: 44px; flex: none; } .medal svg { width: 100%; height: 100%; }
.ttxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .ttxt .small { color: var(--muted); }
.tbar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; } .tbar i { display: block; height: 100%; background: var(--accent); }
.pips { display: flex; gap: 4px; } .pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
/* team preview (Pick 4), as Pokémon Champions: your six down the left, theirs down the right in magenta, the clock on top */
.pvclock { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; padding: 0 18px; background: var(--panel2); border-radius: 999px 0 0 999px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); } .pvclock.warn { color: #fff; background: var(--bad); }
.pvcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 8px 0 14px; }
.pvcol h3 { margin: 0 0 8px; } .pvcol.theirs h3 { text-align: right; }
.pvrow { display: flex; flex-direction: column; gap: 6px; }
.pvmon { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 34px 4px 6px; min-height: 58px; text-align: left; color: #fff;
  background: linear-gradient(100deg, #3b3591, #27226a); border: 0; border-radius: 999px 0 0 999px; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.pvcol.theirs .pvmon { flex-direction: row-reverse; text-align: right; padding: 4px 6px 4px 34px; background: linear-gradient(260deg, #b8236a, #6e1446);
  border-radius: 0 999px 999px 0; clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); }
.pvmon img, .pvmon canvas { flex: 0 0 auto; width: 52px; height: 52px; image-rendering: pixelated; background: rgba(255,255,255,.12); border-radius: 50%; }
.pvtx { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .pvtx b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvcol.theirs .types { justify-content: flex-end; } .pvmon .types { justify-content: flex-start; }
.pvmon.pick { cursor: pointer; } .pvmon.pick:not(:disabled):hover { filter: brightness(1.15); }
.pvmon.pick.on { background: var(--sel); color: var(--selink); box-shadow: none; }
.pvnum { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); font-size: 13px; font-weight: 900; color: var(--sel); background: var(--selink); padding: 2px 8px; border-radius: 999px; white-space: nowrap; } .pvnum:empty { display: none; } .pvnum.lead::after { content: ' · Lead'; }
@media (max-width: 700px) { .pvcols { gap: 8px; } .pvcol h3 .muted, .pvnum.lead::after { display: none; } .pvmon { gap: 6px; min-height: 50px; padding-right: 26px; } .pvcol.theirs .pvmon { padding-left: 26px; }
  .pvmon img, .pvmon canvas { width: 40px; height: 40px; } .pvtx b { font-size: 13px; } .pvmon .type { font-size: 9px; padding: 0 4px; } .pvnum { right: 14px; font-size: 11px; padding: 1px 6px; } }
.pvmega { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--text); }

/* ---------------------------------------------------------------- move buttons (as Pokémon Champions): filled with the move's type,
   a type mark, the name with how well it hits the foe under it, the power on the right; lime when called */
:root { --sel: #d6f531; --selink: #1f2a06; --cursor: #ffd21f; }
.moves { gap: 7px; }
.move { flex-direction: row; align-items: center; gap: 9px; padding: 6px 26px 6px 6px; border: 0; color: #fff; min-height: 56px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--tc) 92%, #fff), color-mix(in srgb, var(--tc) 70%, #000)); text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.move .cd { background: rgba(8,6,24,.55); z-index: 1; }
.move .ty { position: relative; z-index: 2; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--tc); display: grid; place-items: center;
  font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; text-shadow: none; filter: brightness(.85); }
.move .tx { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; flex: 1; }
.move .nm { line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move .meta { color: rgba(255,255,255,.92); font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.move[data-eff=super] .meta { color: #fff36a; } .move[data-eff=weak] .meta, .move[data-eff=none] .meta { color: rgba(255,255,255,.72); }
.move .pw { position: relative; z-index: 2; flex: 0 0 auto; font-style: italic; font-weight: 900; font-size: 18px; }
.move.called { background: var(--sel); color: var(--selink); text-shadow: none; }
.move.called .meta { color: #4a5a10; } .move.called .ty { color: #5a6d00; filter: none; }
.move.placeholder { background: var(--panel2); color: var(--muted); justify-content: center; text-shadow: none; }
.move:disabled { opacity: 1; }
.move kbd { z-index: 2; top: 3px; right: 18px; color: #fff; background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.35); }
@media (max-width: 700px) { .move .ty { width: 26px; height: 26px; font-size: 9px; } .move .pw { font-size: 14px; } .move { padding-right: 20px; gap: 6px; } }
@media (max-height: 500px) and (orientation: landscape) { .move { min-height: 44px; padding: 3px 18px 3px 4px; } .move .ty { width: 24px; height: 24px; font-size: 8.5px; } .move .meta { display: none; } }
#moves.dbl .move .ty, #moves.dbl .move .pw { display: none; }
@media (max-width: 700px) { #moves.dbl .move { min-height: 46px; padding: 4px 14px 4px 8px; } #moves.dbl .move .nm { white-space: normal; } }

/* the rank wheel on the result card (app.js animateRank) */
.rtop { display: flex; align-items: center; gap: 16px; }
.rwheel { position: relative; flex: 0 0 auto; width: 132px; height: 132px; --wc: #2f6fe0; }
.rwheel svg { width: 100%; height: 100%; overflow: visible; }
.rwheel .wt { stroke: #2e2a55; stroke-width: 2.4; stroke-linecap: round; transition: stroke .15s; } .rwheel .wt.on { stroke: #d6f531; }
.rwheel .wtrack { fill: none; stroke: #2c2858; stroke-width: 12; }
.rwheel .wfill { fill: none; stroke-width: 12; stroke-linecap: butt; stroke-dasharray: 0 100; filter: drop-shadow(0 0 4px rgba(214,245,49,.35)); }
.rwheel .wseps line { stroke: var(--panel2, #221f3d); stroke-width: 2.2; }
.rwheel .wcore { fill: #12102a; stroke: rgba(255,255,255,.08); stroke-width: 1.5; }
.rwheel .wdia { fill: #f4f2ff; stroke: var(--wc); stroke-width: 3; }
.rwheel .wemblem { transform-origin: 60px 57px; transform-box: view-box; }
.rwheel .wrank { font: italic 800 11px 'Barlow Condensed', Nunito, sans-serif; fill: #fff; letter-spacing: .06em; }
.rwheel.burst .wemblem, .rwheel.promo .wemblem { animation: wpop .6s cubic-bezier(.2,1.6,.4,1); }
.rwheel.burst svg, .rwheel.promo svg { animation: wflash .6s ease-out; }
.rwheel.drop .wemblem { animation: wdrop .5s ease-out; }
.rwheel.promo { animation: wspin 1s cubic-bezier(.2,.9,.3,1); }
@keyframes wpop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes wflash { 0% { filter: brightness(2.2) drop-shadow(0 0 18px #d6f531); } 100% { filter: none; } }
@keyframes wdrop { 30% { transform: translateY(4px) scale(.9); filter: grayscale(.6); } }
@keyframes wspin { from { transform: rotate(-200deg) scale(.6); } }
.rgain { position: absolute; left: 50%; top: 2px; translate: -50% 0; font: italic 900 26px 'Barlow Condensed', Nunito, sans-serif; opacity: 0; pointer-events: none; text-shadow: 0 2px 0 #000; }
.rgain.up { color: #d6f531; } .rgain.down { color: #ff6a6a; }
.rgain.go { animation: wgain 1.6s ease-out forwards; }
@keyframes wgain { 0% { opacity: 0; translate: -50% 18px; scale: .6; } 20% { opacity: 1; translate: -50% -6px; scale: 1.15; } 70% { opacity: 1; translate: -50% -14px; scale: 1; } 100% { opacity: 0; translate: -50% -28px; } }
.rinfo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; text-align: left; }
.rrank { font: italic 800 30px/1 'Barlow Condensed', Nunito, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.rinfo .rrow b { font-size: 22px; }
/* the menu's standing: a small wheel beside the rank */
.mstand { display: inline-flex; align-items: center; gap: 8px; }
.rwheel.mw { width: 44px; height: 44px; } .rwheel.mw .wrank { display: none; } .rwheel.mw .wfill, .rwheel.mw .wtrack { stroke-width: 14; }
.mstand .mtx { display: flex; flex-direction: column; line-height: 1.1; } .mstand .mtx b { font: italic 800 17px 'Barlow Condensed', sans-serif; text-transform: uppercase; color: var(--text); letter-spacing: .03em; } .mstand .mtx small { font-size: 12px; }
@media (max-width: 420px) { .rwheel:not(.mw) { width: 108px; height: 108px; } .rrank { font-size: 26px; } }
/* team members: a small × to drop one, drag to reorder (app.js sortable) */
.team li, .teammini .slot { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.team li[data-k] { cursor: grab; }
.team li > button.rmx, .rmx { all: unset; box-sizing: border-box; position: absolute; top: 5px; right: 5px; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(11,10,21,.78); color: #d8d4f4; font: 700 16px/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 0 0 1.5px rgba(255,255,255,.18); opacity: .75; transition: opacity .12s, background .12s; }
.rmx:hover, .rmx:focus-visible { opacity: 1; background: #e3262f; color: #fff; }
.team li:hover .rmx { opacity: 1; }
.teammini .slot .rmx { top: -5px; right: -5px; width: 16px; height: 16px; font-size: 12px; }
.dragging { z-index: 20; scale: 1.08; rotate: -2deg; box-shadow: 0 18px 36px rgba(0,0,0,.6) !important; pointer-events: none; cursor: grabbing; transition: scale .15s, rotate .15s; }
.shifting { transition: translate .22s cubic-bezier(.2,.9,.3,1); }   /* the others making room for the held one */
.sorting .rmx { visibility: hidden; }
@media (hover: none) { .rmx { opacity: 1; } }
/* rematch (app.js askRematchBtn): lime; pulses when the other player asked; a note under the buttons */
.rematchnote { margin: 8px 0 0; font-size: 14px; color: var(--muted); min-height: 1.2em; }
.rematchnote.ask { color: #d6f531; font-weight: 800; animation: beat .5s ease-out; } .rematchnote.wait { color: #d8d4f4; }
#askRematchBtn.beckon { animation: beckon 1s ease-in-out infinite; }
@keyframes beckon { 50% { box-shadow: 0 0 0 4px rgba(214,245,49,.45), 0 0 24px rgba(214,245,49,.5); } }
/* the Discord invite: a blurple pill in the top bar (every screen; the logo alone on phones), a small link on the result card */
.discordbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: #5865f2; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; box-shadow: inset 0 -3px 0 #3c45c4; white-space: nowrap; }
.discordbtn:hover { filter: brightness(1.08); } .discordbtn:active { transform: translateY(1px); }
.discordbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .discordbtn { padding: 0; width: 36px; justify-content: center; } .discordbtn span { display: none; } }
.yt.small.dc { margin-top: 2px; } .yt.small.dc svg { color: #5865f2; }
/* the top bar: YouTube beside Discord, and the newest Pokémon scrolling by (wide screens) */
.ytbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: #e3262f; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; box-shadow: inset 0 -3px 0 #8f1118; white-space: nowrap; }
.ytbtn:hover { filter: brightness(1.08); } .ytbtn:active { transform: translateY(1px); } .ytbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.newticker { display: flex; align-items: center; gap: 12px; flex: 0 1 560px; min-width: 0; margin-left: 24px; height: 40px; }
.newticker .tktag { flex: none; padding: 3px 10px; background: #d6f531; color: #1f2a06; font: italic 800 13px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .06em; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.newticker .tkwin { flex: 1; min-width: 0; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.newticker .tktrack { display: flex; gap: 8px; width: max-content; animation: tkscroll 40s linear infinite; }
.newticker:hover .tktrack { animation-play-state: paused; }
@keyframes tkscroll { to { transform: translateX(calc(-50% - 4px)); } }
.tkchip { all: unset; display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(255,255,255,.06); font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer; }
.tkchip:hover { background: rgba(214,245,49,.18); } .tkchip:focus-visible { outline: 2px solid #d6f531; }
.tkchip img, .tkchip canvas { width: 30px; height: 30px; image-rendering: pixelated; border-radius: 50%; background: #221f3d; }
@media (prefers-reduced-motion: reduce) { .newticker .tktrack { animation: none; } .newticker .tkwin { overflow-x: auto; } }
/* wide screens: the ticker replaces the builder's strip; narrower ones keep the strip (no room in the bar) */
@media (min-width: 1000px) { #newStrip { display: none !important; } }
@media (max-width: 999px) { .newticker { display: none !important; } }
@media (max-width: 560px) { .ytbtn { padding: 0; width: 36px; justify-content: center; } .ytbtn span { display: none; } }
.bar .brand { white-space: nowrap; }
.newticker { flex: 1 1 auto; max-width: 620px; }
@media (max-width: 1180px) { .newticker { margin-left: 8px; } .newticker .tktag { display: none; } }
.ytbtn, .discordbtn { flex: none; }
/* small phones: the bar's buttons a little tighter so YouTube and Discord fit beside the rest */
@media (max-width: 420px) {
  .bar { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .bar > .icon { width: 32px; min-width: 32px; padding: 0; }
  .bar .profile { max-width: 112px; } .bar .profile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
/* sharing a replay as a video */
.shseg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 12px; }
.shseg button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; }
.shseg button small { font-size: 11.5px; opacity: .75; font-style: normal; text-transform: none; letter-spacing: 0; font-family: Barlow, sans-serif; font-weight: 600; }
.shseg button[aria-pressed=true] { background: #d6f531; color: #1f2a06; }
.shrange { display: grid; gap: 4px; margin-bottom: 10px; } .shrange input { width: 100%; accent-color: #d6f531; }
.shpreview { display: grid; place-items: center; margin: 6px 0 10px; }
.shpreview canvas, .shpreview video { max-width: 100%; max-height: 52vh; border-radius: 12px; background: #000; box-shadow: 0 0 0 2px #2e2a55; }
.shbar { height: 8px; border-radius: 4px; background: #2e2a55; overflow: hidden; } .shbar i { display: block; height: 100%; width: 0; background: #d6f531; }
.shcaption { background: #100e22; border-radius: 10px; padding: 10px 12px; font-size: 14px; user-select: all; }
/* the part picker: preview, timestamps, the strip with the chosen part as a box */
.tl { margin: 4px 0 10px; }
.tlpreview { position: relative; display: grid; place-items: center; margin-bottom: 8px; }
.tlpreview canvas { width: min(100%, 480px); aspect-ratio: 16 / 9; border-radius: 10px; background: #000; box-shadow: 0 0 0 2px #2e2a55; }
.tlat { position: absolute; bottom: 8px; left: 50%; translate: -50% 0; padding: 2px 10px; border-radius: 999px; background: rgba(11,10,21,.85); font: 700 13px 'JetBrains Mono', monospace; }
.tltimes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tltimes label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.tltimes input { width: 64px; text-align: center; font: 700 15px 'JetBrains Mono', monospace; padding: 5px 4px; }
.tllen { margin-left: auto; font: 700 14px 'JetBrains Mono', monospace; color: #d6f531; } .tllen.warn { color: #f3c63a; }
.tlwrap { position: relative; padding-top: 18px; }
.tlruler { position: absolute; top: 0; left: 0; right: 0; height: 16px; } .tlruler span { position: absolute; translate: -50% 0; font: 600 10.5px 'JetBrains Mono', monospace; color: #8c88b0; white-space: nowrap; }
.tlruler span:first-child { translate: 0 0; } .tlruler span:last-child:not(:first-child) { translate: -100% 0; }
.tlstrip { position: relative; height: 54px; border-radius: 8px; overflow: hidden; background: #100e22; cursor: pointer; touch-action: none; user-select: none; }
.tlstrip.loading { opacity: .5; pointer-events: none; }
.tlthumbs { display: flex; height: 100%; } .tlthumbs canvas { flex: 1; min-width: 0; height: 100%; object-fit: cover; filter: brightness(.85); }
.tlmarks i { position: absolute; top: 0; translate: -50% 0; color: #ff6b72; font-size: 11px; font-style: normal; pointer-events: none; text-shadow: 0 1px 2px #000; }
.tlsel { position: absolute; top: 0; bottom: 0; border: 3px solid #d6f531; border-radius: 6px; background: rgba(214,245,49,.12); cursor: grab; box-shadow: 0 0 0 9999px rgba(8,6,24,.45); }
.tlsel:active { cursor: grabbing; } .tlsel:focus-visible { outline: 2px solid #fff; }
.tlh { position: absolute; top: -3px; bottom: -3px; width: 14px; background: #d6f531; cursor: ew-resize; } .tlh.l { left: -9px; border-radius: 6px 0 0 6px; } .tlh.r { right: -9px; border-radius: 0 6px 6px 0; }
.tlh::after { content: ''; position: absolute; inset: 14px 5px; border-left: 2px solid #1f2a06; border-right: 2px solid #1f2a06; }
.tlhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; translate: -1px 0; pointer-events: none; box-shadow: 0 0 4px #000; }
.tlthumbs canvas { pointer-events: none; }
#shareModal .sheet { width: min(780px, 100%); }
/* the platforms: one tap each (download + caption + upload page) */
.shplat { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.shplat .pl { all: unset; box-sizing: border-box; text-align: center; padding: 11px 8px; border-radius: 12px; color: #fff; font: italic 800 17px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.shplat .pl:hover { filter: brightness(1.1); } .shplat .pl:focus-visible { outline: 3px solid #d6f531; }
.pl.tt { background: #111; box-shadow: inset 3px 0 0 #25f4ee, inset -3px 0 0 #fe2c55; } .pl.yt { background: #e3262f; }
.pl.ig { background: linear-gradient(45deg, #f9a13a, #e1306c 50%, #833ab4); } .pl.fb { background: #1877f2; }
.pl.sc { background: #fffc00; color: #111; } .pl.xx { background: #000; box-shadow: inset 0 0 0 1px #444; }
.shplat-hint { margin-top: 4px; }
#shShare.primary { font-size: 18px; }
.shplat[hidden], .shplat-hint[hidden] { display: none; }
.pl.dc { background: #5865f2; }
/* ---- phones held upright: the turned view (app.js setRender). The court tall on top, edge to edge, its height set by
   the canvas (1080 wide, cropped to fit); a slim top bar; the controls below it: moves 2 x 2 (doubles: a row each),
   the team as one row of round portraits with HP, Auto / Manual ---- */
body.tallplay main { padding: 0; margin: 0; max-width: none; }
body.tallplay .stagebar { min-height: 36px; padding: 2px 8px; margin: 0; }
body.tallplay .stagebar .youtag { font-size: 11.5px; padding: 2px 10px; }
body.tallplay .stage { width: 100% !important; min-width: 0; aspect-ratio: auto; border-radius: 0; margin: 0; }
body.tallplay .stage canvas { height: auto; }
body.tallplay #mini { display: none !important; }
body.tallplay #controls { width: 100%; padding: 6px 8px 8px; }
body.tallplay .bench { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
body.tallplay .bench .mon { min-height: 0; padding: 4px 2px 5px; gap: 3px; border-radius: 999px 999px 14px 14px; }
body.tallplay .bench .mon > span { display: none; }
body.tallplay .bench .mon img, body.tallplay .bench .mon canvas { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3a3570, #15132c); }
body.tallplay .bench .mon .hp { width: 80%; height: 4px; }
body.tallplay .bench .mon kbd { display: none; }
body.tallplay .controls { margin-top: 6px; }
body.tallplay #manualBtn { min-height: 40px; }
body.tallplay .bar { display: none; }   /* (the site's own bar: the battle takes the whole screen; Surrender, sound and help are in the slim bar) */
body.tallplay .clock { top: 25.5vw; transform: translateX(-50%) scale(.85); }   /* (under the plates strip: 300 of 1080 canvas pixels, minus a little) */
body.tallplay .bench .mon { background: transparent !important; box-shadow: none !important; border: 0; border-radius: 12px; clip-path: none; }
body.tallplay .bench .mon.out img, body.tallplay .bench .mon.out canvas { box-shadow: 0 0 0 3px #d6f531; }
body.tallplay .bench .mon:disabled { opacity: .45; }
body.tallplay footer, body.tallplay .legal { display: none; }
body.tallplay #controls { padding: 6px 10px 8px !important; box-sizing: border-box; }
/* phones held upright: compact controls, so the arena gets the rest of the screen */
body.tallplay #moves .move, body.tallplay .moves .move { min-height: 44px; padding: 3px 18px 3px 5px; gap: 6px; }
body.tallplay .move .ty { width: 28px; height: 28px; font-size: 10px; }
body.tallplay .move .nm { font-size: 15px; }
body.tallplay .move .meta { font-size: 10.5px; }
body.tallplay .move .pw { font-size: 20px; }
body.tallplay .moves { gap: 5px; }
body.tallplay .moves.dbl .move { min-height: 36px; }
body.tallplay .moves.dbl .move .ty, body.tallplay .moves.dbl .move .meta { display: none; }
body.tallplay .spotrow { gap: 2px; padding: 2px; }
body.tallplay .spothead .spotname, body.tallplay .spothead .aim { min-height: 26px; padding: 2px 10px; font-size: 13px; }
body.tallplay .bench .mon img, body.tallplay .bench .mon canvas { width: 32px; height: 32px; }
body.tallplay .bench .mon { padding: 2px 1px 3px; gap: 2px; }
body.tallplay .controls { margin-top: 4px; gap: 6px; }
body.tallplay #manualBtn, body.tallplay #megaBtn, body.tallplay #dodgeBtn { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 15px; }
body.tallplay #note { display: none; }
body.tallplay #controls { padding: 4px 8px 6px !important; }
body.tallplay .controls { flex-direction: row !important; align-items: center; flex-wrap: nowrap; }
body.tallplay .controls .bench { flex: 1; min-width: 0; }
body.tallplay #manualBtn, body.tallplay #megaBtn, body.tallplay #dodgeBtn { flex: none; width: auto; min-width: 74px; }
body.tallplay #megaBtn { min-width: 0; }
/* the replay bar: a bigger target to click or drag on (the line itself stays slim) */
.replaybar .rptrack { height: 8px; cursor: pointer; overflow: visible; position: relative; touch-action: none; }
.replaybar .rptrack::before { content: ''; position: absolute; inset: -10px 0; }
.replaybar .rptrack i { position: relative; border-radius: 4px; }
.replaybar .rptrack i::after { content: ''; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; translate: 0 -50%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.35); }

/* PB Grid (app.js renderGrid): the daily 3x3 puzzle, on its own screen or under the search while you wait */
.gridhost { width: 100%; max-width: 520px; margin: 0 auto; }
#searching .gridhost { margin-top: 10px; }
.gridcta { margin-top: 12px; }
.gridhead { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 8px; font-size: 15px; }
.grid3 { display: grid; grid-template-columns: minmax(64px, .8fr) repeat(3, 1fr); gap: 6px; }
.gridcorner { display: grid; place-items: center; font: 900 18px/1 inherit; color: var(--accent); letter-spacing: .05em; }
.gridrule { display: grid; place-items: center; text-align: center; padding: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.2; color: var(--text); min-height: 44px; }
.gridrule .type { font-size: 12px; padding: 3px 8px; }
.gridcell { aspect-ratio: 1; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; min-height: 0; overflow: hidden; }
.gridcell:not(:disabled):hover { border-color: var(--accent); }
.gridcell.got { background: linear-gradient(180deg, #1d3b2a, var(--panel)); border-color: #2f6a47; cursor: default; }
.gridcell.got:not(:disabled) { cursor: pointer; }
.gridcell img, .gridcell canvas { width: 56%; height: auto; image-rendering: pixelated; }
.gridname { font-size: 11px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gridpct { position: absolute; top: 4px; right: 6px; font-size: 10.5px; font-weight: 800; color: var(--accent); }
.gridplus { font-size: 28px; color: var(--muted); line-height: 1; }
.gridcell:disabled { opacity: 1; }
.gridfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; text-align: left; }
.gridhelp { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.gridsheet { width: min(520px, 100%); max-height: 86vh; display: flex; flex-direction: column; gap: 10px; }
.gridsheet h1 { font-size: 18px; margin: 0; }
.gridpicklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; overflow-y: auto; min-height: 120px; }
.gridopt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 11.5px; min-height: 0; }
.gridopt img, .gridopt canvas { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.gridopt:disabled { opacity: 1; cursor: default; }
.gridopt.top { border-color: var(--accent); }

/* keys and controller (controls.js) */
.linkbtn { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
#keysModal .sheet { width: min(620px, 100%); }
.binds { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 14px; }
.binds th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px; }
.binds th.grp { padding-top: 14px; font-size: 13px; color: inherit; border-bottom: 1px solid var(--line); }
.binds td { padding: 3px 4px; }
.binds td:first-child { width: 100%; }
.bind { min-width: 74px; min-height: 30px; padding: 3px 8px; font: 600 12px/1 ui-monospace, monospace; white-space: nowrap; }
.bind.none { color: var(--muted); }
.bind.waiting { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.bindnote { min-height: 1.2em; }
.mon.cursor { box-shadow: 0 0 0 3px #fff inset, 0 0 12px rgba(255,255,255,.5); }
body.usepad .move kbd, body.usepad .mega kbd { display: inline-block; }
@media (pointer: coarse) and (max-width: 700px) { #controlsBtn { display: none; } }
kbd[hidden] { display: none !important; }
/* tap to move (Manual): a ring where the Pokémon is headed */
.tapmark { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid #fff; border-radius: 50%; pointer-events: none; z-index: 5; animation: tapmark .6s ease-out forwards; }
@keyframes tapmark { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.pvmega.autoatk { margin-top: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; cursor: pointer; }
.pvmega.autoatk input { min-height: 0; width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--accent); }
.autoatk-note { margin: 4px 0 0; }
.qualityrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; text-transform: none; letter-spacing: 0; } .qualityrow select { min-height: 36px; padding: 4px 10px; }
/* My Pokémon (the player's own stats) */
.mssort { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.mssort select { min-height: 36px; padding: 4px 8px; }
.mslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.mscard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mshead { display: flex; align-items: center; gap: 10px; }
.mshead img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; flex: none; }
.msname { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.msnum b { display: block; font-size: 17px; }
.msnum span { font-size: 11px; color: var(--muted); }
.msfmt { font-size: 12.5px; color: var(--muted); }
.msmoves { display: flex; flex-direction: column; gap: 4px; }
.msmove { display: grid; grid-template-columns: minmax(0, 1fr) 70px 36px; align-items: center; gap: 8px; font-size: 13px; }
.msmove span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msbar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.msbar i { display: block; height: 100%; background: var(--accent); }
.msmove em { font-style: normal; font-size: 12px; color: var(--muted); text-align: right; }
.card .movehit { font-size: 11.5px; font-weight: 700; color: #7fd6ff; margin-top: 2px; }

/* the Battle Tower (web/tower.js) */
#towerBody { max-width: 1040px; margin: 0 auto; }
.tw-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tw-mode, .tw-end, .tw-board, .tw-foe { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tw-mode h2, .tw-board h2, .tw-end h2 { margin-top: 0; }
.tw-end { margin-bottom: 12px; border-color: var(--accent); }
.tw-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.tw-board ol { list-style: none; margin: 0; padding: 0; }
.tw-board li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--line); }
.tw-board li.you { background: var(--panel2); border-radius: 8px; }
.tw-board .rk { width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tw-board .face, .tw-foe .face { width: 32px; height: 32px; image-rendering: pixelated; }
.tw-foe { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tw-foe .face { width: 64px; height: 64px; }
.tw-foe.boss { border-color: #ff7ad1; box-shadow: 0 0 0 1px #ff7ad1 inset; }
.tw-floor { font-weight: 850; color: var(--accent); }
.tw-cards, .tw-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tw-card, .tw-reward { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; }
button.tw-card:hover, button.tw-reward:hover { border-color: var(--accent); }
.tw-card img, .tw-card canvas, .tw-reward img, .tw-reward canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.tw-card.small img, .tw-card.small canvas { width: 44px; height: 44px; }
.tw-moves { font-size: 12px; color: var(--muted); }
.tw-badge { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 800; color: var(--accent); }
.tw-acts { display: flex; gap: 6px; } .tw-acts .on { border-color: var(--accent); color: var(--accent); }
.tw-kind { font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.tw-reward.boon .tw-kind { color: #ff7ad1; } .tw-reward.teach .tw-kind { color: #7ad1ff; }
.tw-boons { padding-left: 18px; }
/* (the looks, web/looks/*.css, slant every button: the tower's card buttons stay cards) */
#tower button.tw-card, #tower button.tw-reward { border-radius: 12px; clip-path: none; background: var(--panel); border: 1px solid var(--line); padding: 12px 10px; text-transform: none; font-style: normal; letter-spacing: 0; box-shadow: none; transform: none; color: var(--text); }
#tower button.tw-card:hover, #tower button.tw-reward:hover { border-color: var(--accent); background: var(--panel2); }
#tower button.tw-card .nm, #tower button.tw-reward .nm { font-size: 15px; }
#tower .tw-reward .tw-kind { font-size: 12px; }
@media (max-width: 700px) {
  #tower h1 { font-size: 22px; }
  .tw-cards, .tw-team { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .tw-card img, .tw-card canvas, .tw-reward img, .tw-reward canvas { width: 48px; height: 48px; }
  .tw-end, .tw-mode, .tw-board, .tw-foe { padding: 12px; }
  .tw-foe .face { width: 48px; height: 48px; }
}

/* the gimmick reminder before a battle (app.js gimmickCheck) */
.gimmickopts { gap: 8px; margin: 12px 0; } #gimmickAsk .autoatk { justify-content: center; display: flex; gap: 8px; }


/* the Sound panel (app.js openSound) */
.soundpanel { position: fixed; z-index: 60; width: 250px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 10px; }
.soundpanel #sndToggle { width: 100%; }
.sndrow { display: grid; grid-template-columns: 58px 1fr 38px; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.sndrow input { min-height: 0; padding: 0; accent-color: var(--accent); width: 100%; } .sndrow b { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* (visual review 2026-11-01) battle buttons: dark text on light type colours (Electric, Ground, Ice, Fairy...), the type
   token dark there too, effectiveness as a small badge readable on any colour; the Pokémon that is out is marked IN, not
   greyed out as if fainted */
html[data-look] .move.light, .move.light { color: #14121f; }
html[data-look] .move.light .nm, .move.light .nm { text-shadow: none; color: #14121f; }
html[data-look] .move.light .pw, .move.light .pw, .move.light kbd { color: #14121f; }
.move.light .ty { background: #14121f; color: var(--tc); }
html[data-look] .move .meta, .move .meta { width: fit-content; }
html[data-look] .move[data-eff=super] .meta, .move[data-eff=super] .meta { color: #0d2a08; background: #a6f36b; padding: 0 6px; border-radius: 5px; }
html[data-look] .move:is([data-eff=weak], [data-eff=none]) .meta, .move:is([data-eff=weak], [data-eff=none]) .meta { color: #f2f0ff; background: rgba(12,10,26,.55); padding: 0 6px; border-radius: 5px; }
html[data-look] .move.light:not([data-eff]) .meta, html[data-look] .move.light[data-eff=""] .meta { color: rgba(20,18,31,.85); }
.bench .mon { position: relative; }
.bench .mon.out:disabled, body.tallplay .bench .mon.out:disabled { opacity: 1; }
.bench .mon.out::after { content: 'IN'; position: absolute; top: 4px; left: 6px; font: italic 800 11px/1.3 var(--display, sans-serif); background: var(--sel, #d6f531); color: var(--selink, #1f2a06); padding: 0 5px; border-radius: 4px; letter-spacing: .04em; }
/* (visual review) phone roster: the dex number sat on the sprite's corner; the card gives it its own line */
@media (max-width: 700px) { #roster .card { padding-top: 24px; } #roster .card .num { top: 5px; font-size: 10.5px; } }
/* (visual review) the trainer grid scrolls: fade its top and bottom edges so that shows */
.trainers { position: relative; -webkit-mask: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); mask: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); padding-top: 8px; }
/* (visual review) leaderboard: points in a fixed-width box so the rank badges line up; the record never wraps */
#boardRows .bpts { display: inline-block; min-width: 4.5ch; text-align: right; margin-left: 8px; font-variant-numeric: tabular-nums; }
#boardRows td:nth-child(3), #boardRows td:nth-child(4) { white-space: nowrap; }
/* (visual review) Controls sheet: the table is as wide as the sheet's text, not the sheet (the look's 20 px side margins
   pushed a 100%-wide table past the right edge, cutting the controller column); both keyboard columns centred under
   their header */
html[data-look] #keysModal .binds { width: calc(100% - 40px); }
#keysModal .binds th:not(:first-child) { text-align: center; }
/* (visual review) an inline text button (the help's "Controls") stays text: no pill, no taller line */
html[data-look] button.linkbtn { display: inline; padding: 0; min-height: 0; line-height: inherit; background: none; box-shadow: none; clip-path: none; text-transform: none; font-style: normal; letter-spacing: 0; color: var(--accent); }
/* (visual review) trophy room: the titles in a row line up at the top whatever the description's length */
html[data-look] .tgrid .tcard, .tgrid .tcard { align-items: flex-start; }
.tgrid .tcard .medal { align-self: center; }
.tgrid .tcard .ttxt { padding-top: 4px; }
/* (visual review) phone: toasts at the top, under the bar, so they never cover the team and the bottom buttons */
@media (max-width: 700px) { .toast { top: 84px; bottom: auto; max-width: calc(100% - 32px); } }
/* (visual review) the Battle Tower, My Pokémon and Trophy room sat straight on the moving battle scene: they get a dark
   glass panel, and their secondary text a lighter grey */
#towerBody, #myStats, #trophies { background: rgba(10, 9, 22, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 18px; padding: 14px 20px 22px; margin-top: 8px; }
:is(#towerBody, #myStats, #trophies) :is(.muted, p.muted, .small) { color: #bdbad3; }
@media (max-width: 700px) { #towerBody, #myStats, #trophies { padding: 10px 12px 18px; border-radius: 14px; } }
/* the footer at the bottom of the window on short pages, not floating over the middle of the scene */
main { min-height: calc(100vh - 180px); min-height: calc(100dvh - 180px); }
/* (second pass) the effectiveness badge stays one line (cut with … when the button is narrow); phone toasts smaller */
html[data-look] .move .meta, .move .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.move .tx { min-width: 0; }
@media (max-width: 700px) { html[data-look] .move[data-eff] .meta { font-size: 11px; padding: 0 5px; } .toast { font-size: 13px; padding: 8px 12px; max-width: 300px; } }
/* (visual review, round 2) an empty team slot says what to do: + Add Pokémon (it goes to the list) */
.team li > button .add { font: italic 900 34px/1 var(--display, sans-serif); color: var(--sel, #d6f531); margin-top: 6px; }
.team li > button .empty { font-weight: 700; color: var(--text); opacity: .85; }
/* (visual review, round 2) phones: the menu buttons wrap into compact rows (a sideways scroller hid most of them), the
   format tabs stay on one line each, and the trainer button is the face alone */
@media (max-width: 700px) {
  .playnav, html[data-look] .playnav { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; row-gap: 6px; margin-top: 14px; }
  .navgroup { flex-wrap: wrap; gap: 6px; flex: 1 1 100%; }
  .navlbl { flex: 1 1 100%; margin: 2px 0 -2px; }
  html[data-look] .playnav button, .playnav button { font-size: 13px; padding: 6px 12px; min-height: 36px; }
  .seg button, html[data-look] .seg button { white-space: nowrap; }
  html[data-look] :is(#formats, #boardFormats, #roomFormats) button { font-size: 13px; padding-left: 9px; padding-right: 9px; }
  html[data-look] :is(#formats, #boardFormats, #roomFormats) { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  html[data-look] :is(.seg button[aria-selected=true], #modes button[aria-selected=true])::before { margin-right: 3px; }
  #profileBtn #who { display: none; }
  html[data-look] #profileBtn { padding-left: 10px; padding-right: 14px; }
}
/* (visual review, round 2) phone battle cards: types, status and stat changes under the name (the arena's plates are off) */
#mini .side .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 5px; min-height: 18px; }
#mini .side .tags .type { font-size: 10px; padding: 1px 6px; }
#mini .stchip { font: 800 10px/1.5 Barlow, sans-serif; padding: 0 5px; border-radius: 4px; background: #2e2a55; color: #e6e3f7; }
#mini .stchip.up { background: #1f5134; color: #b9f5c8; } #mini .stchip.down { background: #5a2130; color: #ffc3cc; }
#mini .stchip.st-brn { background: #a8461f; color: #fff; } #mini .stchip.st-par { background: #c9a10f; color: #1b1500; } #mini .stchip.st-psn, #mini .stchip.st-tox { background: #7b3a8f; color: #fff; }
#mini .stchip.st-slp { background: #55607a; color: #fff; } #mini .stchip.st-frz { background: #3fa7c7; color: #062530; }
/* (visual review, round 2) the turn-your-phone hint as a small chip, not a full row of large text */
@media (max-width: 700px) {
  .rotate:not([hidden]) { display: flex; width: fit-content; max-width: calc(100% - 32px); align-items: center; gap: 10px; margin: 14px auto 0; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; color: #cfcce4; }
  html[data-look] .rotate #rotateOk { min-height: 30px; padding: 4px 14px; font-size: 12px; }
}
/* (visual review, round 2) phone leaderboard: one line a row (the name went under the face, rows twice as tall) */
@media (max-width: 700px) {
  html[data-look] #board .table td { padding: 7px 6px; }
  html[data-look] #board .table td:first-child { width: 36px; font-size: 16px; }
  #boardRows td:nth-child(2) { white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  #board .table td img { width: 24px; height: 24px; margin-right: 6px; }
  #boardRows .tier { font-size: 10px; }
  #boardRows .bpts { min-width: 3ch; margin-left: 4px; }
}
/* phone battle cards: the trainer's name and a ball per Pokémon left (the arena's plates are off on phones) */
#mini .side .who { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 0; }
#mini .side .who .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mini .side .balls { display: flex; gap: 3px; flex: none; }
#mini .side .balls i { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(180deg, #e8341c 0 45%, #16151d 45% 55%, #f1f1f5 55%); box-shadow: 0 0 0 1px #16151d; }
#mini .side .balls i.out { background: #4a4760; opacity: .55; }

/* Higher or Lower while waiting (web/hilo.js) */
.hilo { width: min(100%, 520px); margin: 12px auto 0; padding: 14px 16px 16px; border-radius: 16px; background: rgba(23,22,43,.88); border: 1px solid var(--line); text-align: center; }
.hlhead { display: flex; align-items: center; font: italic 800 15px var(--display, sans-serif); letter-spacing: .03em; text-transform: uppercase; }
.hlstreak { color: var(--sel, #d6f531); } .hlbest { color: var(--muted); }
.hlq { margin: 10px 0 12px; font-size: 16px; line-height: 1.35; } .hlq .hlstat { color: var(--accent); }
.hlrow { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hlvs { font: italic 900 22px var(--display, sans-serif); color: var(--muted); }
.hlcard { flex: 1 1 0; max-width: 190px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 14px; background: var(--panel2); border: 2px solid transparent; transition: border-color .2s; }
.hlcard img, .hlcard canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.hlname { font-weight: 800; font-size: 14px; }
.hlval { font: italic 900 32px var(--display, sans-serif); line-height: 1; }
.hlcard.ok { border-color: var(--good); } .hlcard.ok .hlval { color: var(--good); animation: popIn .3s; }
.hlcard.bad { border-color: var(--bad); } .hlcard.bad .hlval { color: var(--bad); }
.hlbtns { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hlbtns button { min-width: 140px; }
.hlmsg { flex: 1 1 100%; font-size: 14px; color: #cfcce4; }
@media (max-width: 700px) { .hlcard img, .hlcard canvas { width: 56px; height: 56px; } .hlval { font-size: 26px; } .hlbtns button { min-width: 0; flex: 1; } }

/* replays are kept for 24 hours: the notice under the replay bar and in the share sheet */
.replaybar .rpnote { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.shkeep { margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); font-size: 14px; font-weight: 600; }

/* the switch wait (app.js benchWait): a dark shade over the bench cards that drains from the top as the wait runs out */
.bench.waiting .mon:not(.out):not(:disabled)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: rgba(8, 10, 20, 0.55); transform-origin: bottom; transform: scaleY(var(--wait, 0)); }
.bench.choosing .mon::after { display: none; }
/* the activity banner over the menu (app.js renderActivity) */
.activity { overflow: hidden; white-space: nowrap; margin: -4px 0 10px; padding: 5px 0; font-size: 13px; color: var(--muted, #9aa3c4); border-bottom: 1px solid var(--line); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.activity[hidden] { display: none; }
.activity .track { display: inline-flex; }
.activity .run { display: inline-flex; gap: 0; padding-right: 40px; }
.activity:not(.roll) .run + .run { display: none; }
.activity.roll .track { animation: activityRoll 40s linear infinite; }
.activity .it { padding: 0 6px; } .activity .it b { color: var(--accent, #d6f04a); font-weight: 700; }
.activity .dot { opacity: 0.5; }
@keyframes activityRoll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .activity.roll .track { animation: none; } }

/* ---------------------------------------------------------------- public profiles (app.js): the player card */
.showcase { margin: 14px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.scpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 6px; }
.scpick button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; min-height: 0; font-size: 11px; background: rgba(255,255,255,.04); border: 2px solid transparent; border-radius: 10px; text-transform: none; }
.scpick button img, .scpick button canvas { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 8px; }
.scpick button[aria-pressed="true"] { border-color: var(--accent); background: rgba(214,245,49,.08); }
.scpick button i { position: absolute; top: -6px; left: -4px; font-style: normal; font-weight: 800; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: var(--accent); color: #0b0d16; }
.pcsheet { width: min(620px, 100%); }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #1b2036, #0f1220 70%); border: 1px solid var(--line); }
.pcard .pchead { display: flex; align-items: center; gap: 12px; }
.pcard .pchead img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 12px; background: rgba(255,255,255,.05); }
.pcard .pchead h2 { margin: 0; font-size: 26px; line-height: 1.1; }
.pcard .pcfmts { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard .pcfmt { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.05); font-size: 13px; }
.pcard .pcmons { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; }
.pcard .pcmon { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.04); border: 2px solid var(--mastery, rgba(255,255,255,.08)); text-align: center; font-size: 12px; }
.pcard .pcmon img, .pcard .pcmon canvas { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 10px; }
.pcard .pcmon.ace img, .pcard .pcmon.ace canvas { width: 84px; height: 84px; }
.pcard .pcmon b { font-size: 13px; } .pcard .pcmon .lbl { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
.pcard .pcmon .tierlbl { font-weight: 700; color: var(--mastery, #c4cbe4); }
@media (max-width: 520px) { .pcard .pcmons { grid-template-columns: 1fr 1fr; } }
.lb-name { cursor: pointer; } .lb-name:hover { text-decoration: underline; }
#cardModal { z-index: 45; }   /* over the profile it is opened from */

/* ---------------------------------------------------------------- vote for the next Pokémon (app.js) */
.votestate { font-weight: 700; color: #c4cbe4; } .votestate.ready { color: var(--accent); }
.votetop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.votetop .vt { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 10px; background: rgba(255,255,255,.05); }
.votetop .vt img { width: 40px; height: 40px; image-rendering: pixelated; } .votetop .vt i { font-style: normal; font-weight: 800; color: var(--accent); }
.votebar { gap: 8px; margin-bottom: 10px; } .votebar input[type=search] { flex: 1 1 200px; min-width: 0; }
.votegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.vcard { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-align: center; }
.vcard img { width: 96px; height: 96px; margin: -10px 0 -12px; image-rendering: pixelated; }   /* (the sprites carry their own padding) */
.vcard b { font-size: 14px; } .vcard .vcount { font-weight: 700; } .vcard button { margin-top: 4px; min-width: 80px; }
.vcard.inranked { opacity: .55; } .vcard .inr { color: var(--accent); font-weight: 700; }
.vcard.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* a tournament's live matches at once (web/multiwatch.js): the grid fills the window below a slim bar; each tile is an arena
   at 16:9 with both sides' names, Pokémon left and team HP over its top edge. Tap a tile: that one full size. */
.cuplive { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
body[data-screen=multi] .bar, body[data-screen=multi] .legal, body[data-screen=multi] #backdrop, body[data-screen=multi] .backshade { display: none; }
body.multiwatching main { max-width: none; padding: 6px 8px 8px; }
.mwbar { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 2px 6px; }
.mwbar button { min-height: 36px; }
.mwtitle { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.mwnote { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mwgrid { display: grid; gap: 8px; justify-content: center; align-content: center; height: calc(100dvh - 60px); }
#multi { position: relative; }
.mwempty { position: absolute; left: 16px; right: 16px; top: 45%; text-align: center; margin: 0; }
.mwtile { width: var(--tw); aspect-ratio: 16 / 9; cursor: pointer; border-radius: 10px; overflow: hidden; outline-offset: 0; }
.mwtile:hover .mwarena { box-shadow: 0 0 0 2px var(--accent); }
.mwarena { position: relative; width: 100%; height: 100%; background: #0b0d16; border-radius: 10px; overflow: hidden; }
.mwarena canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.mwhud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 6px; padding: 4px 6px 10px;
  background: linear-gradient(rgba(11,13,22,.82), rgba(11,13,22,0)); font-size: clamp(10px, calc(var(--tw) / 42), 15px); pointer-events: none; }
.mwside { flex: 1; min-width: 0; }
.mwside.s1 { text-align: right; }
.mwnm { font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.mwside.s0 .mwnm { color: #ffb4a8; } .mwside.s1 .mwnm { color: #b4c8ff; }
.mwballs { display: flex; gap: 3px; margin: 2px 0; } .mwside.s1 .mwballs { justify-content: flex-end; }
.mwballs i { width: .7em; height: .7em; border-radius: 50%; background: linear-gradient(#e8341c 0 45%, #222 45% 55%, #f4f4f4 55%); box-shadow: 0 0 0 1px #000; }
.mwballs i.down { background: #555; opacity: .6; }
.mwside .hp { height: .5em; width: 100%; } .mwside.s1 .hp { transform: scaleX(-1); }
.mwclock { font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; padding-top: 1px; }
.mwwait { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11,13,22,.7); font-weight: 800; }
.mwresult { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; align-items: center; padding: 8px; background: linear-gradient(rgba(11,13,22,0), rgba(11,13,22,.9));
  font-size: clamp(12px, calc(var(--tw) / 26), 26px); text-shadow: 0 2px 6px #000; }
.mwresult b { color: var(--accent); font-weight: 900; } .mwresult span { font-size: .6em; color: var(--muted); }
.mwtile.over canvas { filter: saturate(.7); }
.mwtile.plates .mwhud { display: none; }
.mwresult:empty { display: none; }
.mwgrid.focused .mwtile { cursor: default; }
.mwgrid.focused .mwtile:hover .mwarena { box-shadow: none; }
@media (max-height: 500px) and (orientation: landscape) { .mwbar { min-height: 32px; padding-bottom: 4px; } .mwgrid { height: calc(100dvh - 46px); gap: 6px; } body.multiwatching main { padding: 4px 6px; } }
