: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; }
.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; }
.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; }
.ytask { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,0,51,.5); background: rgba(255,0,51,.08); text-align: center; animation: popIn .3s cubic-bezier(.2,1.3,.4,1) .4s backwards; }
.ytask p { margin: 0 0 10px; font-size: 14px; }
.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); }
.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; }
@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; }
@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; }
.tier[data-tier=Bronze] { background: #7a4a2a; } .tier[data-tier=Silver] { background: #6b7590; } .tier[data-tier=Gold] { background: #a07a10; }
.tier[data-tier=Platinum] { background: #2f8f8a; } .tier[data-tier=Diamond] { background: #3a6ae8; } .tier[data-tier=Master] { background: #8a3ad8; }
.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; }
.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; }
  .endcard { top: auto; bottom: 12px; transform: translateX(-50%); }
  @keyframes cardIn { from { opacity: 0; transform: translate(-50%, 30%); } }
}
@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%; }
  .endcard { top: 50% !important; bottom: auto !important; transform: translate(-50%, -50%) !important; }
  .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; }
@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; } }
