/* greed's Activity: the greed × Pokémon look (default) and greed's own black and white. */
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/pixelify-400.woff2") format("woff2"); }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/pixelify-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/bricolage-400.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/bricolage-600.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/bricolage-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/bricolage-800.woff2") format("woff2"); }
/*
 * Two looks. "poke" (the default) is greed × Pokémon: greed's black, white and hairlines, with
 * Pokémon colour only where it means something: type badges, right and close, HP, shinies, the
 * group colours, and one red Poké Ball. "greed" is greed's own black and white, all the way.
 * Every colour is a token here, so a component never says which look it's in.
 */
:root {
  --font: "Bricolage Grotesque", system-ui, sans-serif; --title-font: "Bricolage Grotesque", system-ui, sans-serif;
  --bg: #0a0a0a; --bg-art:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.022' stroke-width='3'%3E%3Ccircle cx='75' cy='75' r='36'/%3E%3Cpath d='M39 75h25M86 75h25'/%3E%3Ccircle cx='75' cy='75' r='10'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(120% 50% at 50% 0%, #171717 0%, #0d0d0d 55%, #0a0a0a 100%);
  --panel: #111111; --raise: #191919; --line: #262626; --ink: #ededed; --muted: #a3a3a3; --faint: #6b6b6b;
  --accent: #ededed; --accent-ink: #0a0a0a; --accent-edge: transparent;
  --card: #111111; --card-ink: #ededed; --card-line: #262626; --card-shadow: none;
  --right: #36a361; --right-ink: #ffffff; --close: #cf9f2c; --close-ink: #161003; --wrong: #161616; --wrong-ink: #ededed; --bad: #e5484d;
  --g1: #d9b23c; --g2: #45a067; --g3: #4a80c8; --g4: #8c63c6; --g-ink: #0a0a0a;
  --title-fill: #ededed; --title-stroke: transparent; --title-shadow: none;
  --sil: brightness(0) saturate(100%); --rim: rgba(255,255,255,.8); --rim-glow: rgba(255,255,255,.12);
  --stage: repeating-conic-gradient(from 0deg at 50% 45%, #141414 0deg 9deg, #101010 9deg 18deg);
  --stage-glow: radial-gradient(circle at 50% 45%, rgba(255,255,255,.07) 0, rgba(255,255,255,0) 55%);
  --easy: #36a361; --medium: #cf9f2c; --hard: #e5484d; --veil: rgba(0,0,0,.78);
  --poke: #e3350d; --hp-hi: #3fb06a; --hp-mid: #d9a62e; --hp-lo: #e5484d; --xp: #4a87d6; --shiny: #e6c35c;
  --grass: linear-gradient(90deg, rgba(63,176,106,.13), rgba(63,176,106,.02)); --grass-line: rgba(63,176,106,.32);
  --arena: linear-gradient(#101010 0 52%, #151515 52% 100%); --arena-wild: linear-gradient(#0e110f 0 52%, #0f1a12 52% 100%);
  --arena-elite: linear-gradient(#110f15 0 52%, #17121d 52% 100%); --pad: radial-gradient(closest-side, rgba(255,255,255,.1), rgba(255,255,255,0));
  --discord: #313338; --discord-edge: #1e1f22;
  color-scheme: dark;
}
:root[data-look="greed"] {
  --font: "Bricolage Grotesque", system-ui, sans-serif; --title-font: "Bricolage Grotesque", system-ui, sans-serif;
  --bg: #0a0a0a; --bg-art: none;
  --panel: #121212; --raise: #1a1a1a; --line: #2a2a2a; --ink: #ededed; --muted: #a3a3a3; --faint: #6b6b6b;
  --accent: #ededed; --accent-ink: #0a0a0a; --accent-edge: transparent;
  --card: #121212; --card-ink: #ededed; --card-line: #2a2a2a; --card-shadow: none;
  --right: #ededed; --right-ink: #0a0a0a; --close: #7d7d7d; --close-ink: #0a0a0a; --wrong: #1c1c1c; --wrong-ink: #ededed; --bad: #e5484d;
  --g1: #f2f2f2; --g2: #c4c4c4; --g3: #969696; --g4: #6b6b6b; --g-ink: #0a0a0a;
  --title-fill: #ededed; --title-stroke: transparent; --title-shadow: none;
  --sil: brightness(0) invert(1); --stage: radial-gradient(circle at 50% 42%, #1d1d1d, #121212 70%); --stage-glow: none;
  --easy: #ededed; --medium: #ededed; --hard: #ededed; --veil: rgba(0,0,0,.75);
  --poke: #ededed; --hp-hi: #ededed; --hp-mid: #8a8a8a; --hp-lo: #e5484d; --xp: #6b6b6b; --shiny: #ededed;
  --grass: #121212; --grass-line: #2a2a2a; --arena: #101010; --arena-wild: #101010; --arena-elite: #101010; --pad: radial-gradient(closest-side, rgba(255,255,255,.07), rgba(255,255,255,0));
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--discord-edge); color: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }
img.px { image-rendering: pixelated; object-fit: contain; }

.frame { max-width: 960px; margin: 0 auto; min-height: 100%; background: var(--bg-art), var(--bg); background-attachment: local; display: flex; flex-direction: column; }
.chrome { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--discord); border-bottom: 1px solid var(--discord-edge); font-family: "Segoe UI", system-ui, sans-serif; font-size: .85rem; color: #dbdee1; }
.chrome .app { width: 26px; height: 26px; border-radius: 50%; background: #0a0a0a; border: 1px solid #444; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; }
.chrome .where { color: #949ba4; }
.chrome .mock { margin-left: auto; background: #f0b232; color: #111; border-radius: 99px; padding: 2px 9px; font-size: .72rem; font-weight: 700; }

/* The games menu: one row that scrolls sideways on a phone (no fade mask: it breaks on iPhone). */
.games { display: flex; gap: 8px; padding: 14px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.games::-webkit-scrollbar { display: none; }
.games button { flex: none; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 16px 5px 6px; min-height: 46px; font-size: .95rem; font-weight: 700; color: var(--muted); }
.games button img { width: 34px; height: 34px; }
.games button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 3px 0 var(--accent-edge); }

.game { flex: 1; padding-inline: 16px; padding-block: 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.game[hidden] { display: none; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-family: var(--title-font); font-weight: 800; font-size: clamp(1.9rem, 6.5vw, 2.7rem); letter-spacing: -.035em; line-height: 1; color: var(--title-fill);
  -webkit-text-stroke: 6px var(--title-stroke); paint-order: stroke fill; text-shadow: var(--title-shadow); }
:root[data-look="greed"] h1 { font-weight: 800; letter-spacing: -.035em; -webkit-text-stroke: 0; }
.day { color: var(--faint); font-size: .9rem; font-weight: 700; }
.tools { margin-left: auto; display: flex; gap: 8px; }
.pill { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 8px 14px; font-size: .9rem; font-weight: 700; min-height: 42px; min-width: 42px; }
.pill:hover:not(:disabled) { border-color: var(--muted); }
.pill:disabled { opacity: .4; cursor: default; }
.pill.main, .btn.main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 4px 0 var(--accent-edge); font-weight: 800; }
.pill.main:active:not(:disabled), .btn.main:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-edge); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--panel); }
.seg button { border: 0; background: none; border-radius: 99px; padding: 7px 14px; font-size: .88rem; font-weight: 700; color: var(--muted); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.diff button[aria-pressed="true"][data-d="easy"] { background: var(--easy); color: #fff; }
.diff button[aria-pressed="true"][data-d="medium"] { background: var(--medium); color: #3d2f00; }
.diff button[aria-pressed="true"][data-d="hard"] { background: var(--hard); color: #fff; }
:root[data-look="greed"] .diff button[aria-pressed="true"] { color: #0a0a0a; }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; font-weight: 600; }
.status b { color: var(--ink); }
.pips { display: flex; gap: 5px; flex-wrap: wrap; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 0 var(--accent-edge); transition: background .3s, transform .3s; }
.pip.used { background: var(--line); box-shadow: none; transform: scale(.8); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; border: 2px dashed var(--line); border-radius: 18px; line-height: 1.5; font-weight: 600; }

/* ---- pokédle ---- */
.search { position: relative; }
.search input { width: 100%; background: var(--card); color: var(--card-ink); border: 2px solid var(--card-line); box-shadow: var(--card-shadow); border-radius: 16px; padding: 15px 16px 15px 48px; font: inherit; font-size: 1.05rem; font-weight: 700; outline: none; }
.search input::placeholder { color: color-mix(in srgb, var(--card-ink) 55%, transparent); }
.search input:focus { border-color: var(--accent); }
.search input:disabled { opacity: .55; }
.search .glass { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border: 3px solid var(--card-ink); border-radius: 50%; opacity: .55; z-index: 1; }
.search .glass::after { content: ""; position: absolute; width: 7px; height: 3px; background: var(--card-ink); right: -7px; bottom: -4px; transform: rotate(45deg); }
.list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.opt { display: flex; align-items: center; gap: 12px; padding: 7px 12px; width: 100%; border: 0; background: none; text-align: left; min-height: 52px; }
.opt img { width: 40px; height: 40px; }
.opt .n { font-weight: 800; }
.opt .meta { margin-left: auto; opacity: .6; font-size: .82rem; font-weight: 700; }
.opt.on, .opt:hover { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.list .none { padding: 14px; font-weight: 700; opacity: .7; }
.hint { display: flex; align-items: center; gap: 16px; background: var(--stage); border-radius: 18px; padding: 12px 16px; animation: rise .4s ease; position: relative; overflow: hidden; }
.hint::before { content: ""; position: absolute; inset: 0; background: var(--stage-glow); pointer-events: none; }
.hint img { width: 72px; height: 72px; filter: var(--sil); position: relative; }
.hint div { position: relative; }
.hint b { display: block; font-family: var(--title-font); font-weight: 800; font-size: 1.1rem; color: var(--title-fill); -webkit-text-stroke: 4px var(--title-stroke); paint-order: stroke fill; }
:root[data-look="greed"] .hint b { -webkit-text-stroke: 0; font-size: 1.05rem; }
.hint span { color: #fff; font-size: .9rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.board { display: flex; flex-direction: column; gap: 10px; }
.guess { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: stretch; animation: rise .35s ease; }
.who { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); box-shadow: var(--card-shadow); border-radius: 14px; padding: 4px; }
.who img { width: 54px; height: 54px; }
.who b { font-size: .84rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tile { perspective: 600px; min-width: 0; height: 80px; }
.tile .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s ease; }
.tile.flip .in { transform: rotateX(180deg); }
.tile .face { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px; text-align: center; }
.tile .front { background: var(--panel); border: 1px solid var(--line); }
.tile .back { transform: rotateX(180deg); }
.tile .k { font-size: .68rem; font-weight: 800; opacity: .78; line-height: 1.1; text-transform: lowercase; }
.tile .v { font-weight: 800; font-size: 1.04rem; line-height: 1.1; }
.tile .a { font-size: .72rem; font-weight: 800; line-height: 1; }
.yes { background: var(--right); color: var(--right-ink); }
.near { background: var(--close); color: var(--close-ink); }
.no { background: var(--wrong); color: var(--wrong-ink); border: 1px solid var(--line); }
/* A type as the games draw it: its own colour, in a little badge. */
.type { display: inline-block; border-radius: 6px; padding: 2px 8px; color: #fff; font-size: .8rem; font-weight: 800; text-shadow: 0 1px 1px rgba(0,0,0,.3); }
:root[data-look="greed"] .type { background: none !important; color: inherit; text-shadow: none; border: 0; padding: 0; font-size: 1.04rem; }
.t-normal { background: #9fa19f; } .t-fire { background: #e62829; } .t-water { background: #2980ef; } .t-grass { background: #3fa129; } .t-electric { background: #fac000; }
.t-ice { background: #3dcef3; } .t-fighting { background: #ff8000; } .t-poison { background: #9141cb; } .t-ground { background: #915121; } .t-flying { background: #81b9ef; }
.t-psychic { background: #ef4179; } .t-bug { background: #91a119; } .t-rock { background: #afa981; } .t-ghost { background: #704170; } .t-dragon { background: #5060e1; }
.t-dark { background: #624d4e; } .t-steel { background: #60a1b8; } .t-fairy { background: #ef70ef; } .t-none { background: rgba(0,0,0,.25); }
.key { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.key i { display: inline-block; width: 14px; height: 14px; border-radius: 5px; vertical-align: -2px; margin-right: 5px; }
@media (max-width: 640px) {
  .guess { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .who { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 4px 10px; }
  .who img { width: 36px; height: 36px; }
  .who b { font-size: .98rem; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile { height: 72px; }
  .type { font-size: .72rem; padding: 2px 6px; }
}

/* ---- groups ---- */
.l1 { background: var(--g1); } .l2 { background: var(--g2); } .l3 { background: var(--g3); } .l4 { background: var(--g4); }
.found { display: flex; flex-direction: column; gap: 10px; }
.found .count { color: var(--muted); font-size: .98rem; font-weight: 700; }
.found .count b { color: var(--ink); font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.chip { border: 0; border-radius: 99px; padding: 8px 14px; color: var(--g-ink); font-size: .9rem; font-weight: 700; min-height: 38px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.chip.ghost { background: none; border: 2px dashed var(--faint); color: var(--muted); box-shadow: none; }
.chip.ghost b { color: var(--ink); }
.chip.lit { outline: 3px solid var(--ink); outline-offset: 2px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.card4 { position: relative; border: 2px solid var(--card-line); background: var(--card); color: var(--card-ink); box-shadow: var(--card-shadow); border-radius: 18px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 122px; min-width: 0; transition: transform .12s, background .15s; }
.card4 img { width: 70px; height: 70px; transition: transform .15s; }
.card4:hover:not(:disabled) img { transform: scale(1.05); }
.card4 span { font-size: .86rem; font-weight: 800; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.card4[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--card)); border-color: var(--accent); transform: translateY(-2px); }
:root[data-look="greed"] .card4[aria-pressed="true"] { background: var(--ink); color: #0a0a0a; }
.card4.lit { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink); }
:root:not([data-look="greed"]) .card4.lit { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card4 .dots { display: flex; gap: 3px; min-height: 9px; }
.card4 .dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.25); }
.card4:active:not(:disabled) { transform: scale(.94); }
.card4:disabled { cursor: default; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mist { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: .92rem; font-weight: 700; }
@media (max-width: 640px) {
  .grid4 { gap: 6px; }
  .card4 { min-height: 98px; padding: 6px 2px 5px; border-radius: 14px; }
  .card4 img { width: 52px; height: 52px; }
  .card4 span { font-size: .72rem; }
}

/* ---- who's that: the TV show's sunburst ---- */
.stage { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 16px; background: var(--stage); border: 1px solid var(--line); border-radius: 26px; padding: 22px 16px; }
.stage::before { content: ""; position: absolute; inset: 0; background: var(--stage-glow); pointer-events: none; }
.stage > * { position: relative; }
.stage .q { font-family: var(--title-font); font-size: clamp(1.5rem, 6vw, 2.1rem); color: var(--title-fill); -webkit-text-stroke: 6px var(--title-stroke); paint-order: stroke fill; text-shadow: var(--title-shadow); text-align: center; line-height: 1.05; }
:root[data-look="greed"] .stage .q { -webkit-text-stroke: 0; font-weight: 800; }
.stage img.big { width: min(210px, 56vw); height: min(210px, 56vw); filter: var(--sil) drop-shadow(0 0 1.5px var(--rim)) drop-shadow(0 0 14px var(--rim-glow)); }
:root[data-look="greed"] .stage img.big:not(.shown) { filter: var(--sil); }
.stage img.big.shown { filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); animation: reveal .5s cubic-bezier(.2,1.4,.4,1); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 540px; }
.choices button { border: 2px solid var(--card-line); background: var(--card); color: var(--card-ink); box-shadow: var(--card-shadow); border-radius: 16px; padding: 14px 10px; font-weight: 800; font-size: 1.02rem; min-height: 56px; }
.choices button:hover:not(:disabled) { transform: translateY(-2px); }
.choices button.good { background: var(--right); color: var(--right-ink); border-color: var(--right); }
.choices button.badpick { background: var(--bad); color: #fff; border-color: var(--bad); }
.choices button:disabled { cursor: default; }
.choices button:disabled:not(.good):not(.badpick) { opacity: .6; }

.riddle { gap: 12px; align-items: stretch; }
.clues { display: flex; flex-direction: column; gap: 8px; }
.clue { background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; text-align: left; backdrop-filter: blur(2px); animation: rise .35s ease; }
:root[data-look="greed"] .clue { background: var(--panel); }
.clue .lab { font-size: .74rem; font-weight: 700; color: var(--faint); margin-bottom: 4px; }
.clue .txt { font-size: 1.05rem; line-height: 1.45; font-weight: 600; color: var(--ink); }
.clue .txt b { font-weight: 800; }
.clue .from { color: var(--muted); margin-left: 6px; }
.clue.locked { background: none; border-style: dashed; animation: none; }
.clue.locked .txt { color: var(--faint); font-size: .92rem; }
.riddle img.big { align-self: center; }
.reveal { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; animation: pop .4s ease; }
.reveal b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.reveal span { color: var(--muted); font-weight: 600; }
#whoWrong .chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 4px; }
#whoWrong img { width: 26px; height: 26px; }

/* ---- higher or lower ---- */
.hl { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.mon { background: var(--card); color: var(--card-ink); border: 2px solid var(--card-line); box-shadow: var(--card-shadow); border-radius: 22px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; animation: rise .35s ease; }
.mon img { width: min(140px, 30vw); height: min(140px, 30vw); }
.mon b { font-size: 1.12rem; font-weight: 800; }
.mon .num { font-family: var(--title-font); font-weight: 800; font-size: 2.1rem; letter-spacing: -.02em; }
.mon .lab { opacity: .7; font-size: .85rem; font-weight: 800; }
/* VS on a Poké Ball. */
.vs { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); background: var(--raise); border: 1px solid var(--line); }
:root[data-look="greed"] .vs { width: auto; height: auto; background: none; border: 0; color: var(--faint); text-shadow: none; }
.ask { text-align: center; font-size: 1.12rem; line-height: 1.4; font-weight: 700; color: var(--muted); }
.ask b { color: var(--ink); }
.hlbtns { display: flex; gap: 10px; justify-content: center; }
.hlbtns button { min-width: 150px; min-height: 54px; border-radius: 99px; border: 0; font-weight: 800; font-size: 1.08rem; color: #fff; }
#hlHigher { background: var(--right); color: var(--right-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--right) 60%, #000); }
#hlLower { background: var(--bad); box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 60%, #000); }
:root[data-look="greed"] .hlbtns button { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line); box-shadow: none !important; }
.hlbtns button:active:not(:disabled) { transform: translateY(2px); }
.hlbtns button:disabled { opacity: .5; cursor: default; }
@media (max-width: 640px) { .hl { gap: 6px; } .mon { padding: 12px 6px; } .mon .num { font-size: 1.5rem; } .vs { width: 40px; height: 40px; font-size: .75rem; } .hlbtns button { min-width: 0; flex: 1; } }

/* ---- shared ---- */
.veil { position: fixed; inset: 0; background: var(--veil); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .25s ease; overflow-y: auto; }
.card { width: min(430px, 100%); background: var(--raise); border: 2px solid var(--line); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: pop .45s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.card img.big { width: 150px; height: 150px; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(0,0,0,.25)); }
.card h2 { margin: 0; font-family: var(--title-font); font-weight: 800; letter-spacing: -.03em; font-size: 2rem; color: var(--title-fill); -webkit-text-stroke: 5px var(--title-stroke); paint-order: stroke fill; text-shadow: var(--title-shadow); line-height: 1.05; }
:root[data-look="greed"] .card h2 { -webkit-text-stroke: 0; font-weight: 800; letter-spacing: -.03em; }
.card p { margin: 0; color: var(--muted); line-height: 1.45; font-weight: 600; }
.card .prize { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.card .prize span { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 5px 13px; font-size: .92rem; font-weight: 800; box-shadow: 0 3px 0 var(--accent-edge); }
.card .sq { font-size: 1.05rem; line-height: 1.15; letter-spacing: 1px; }
.btn { border: 0; border-radius: 99px; padding: 11px 20px; font-weight: 800; min-height: 46px; }
.btn.ghost { background: none; border: 2px solid var(--line); }
.next { font-size: .85rem; color: var(--faint); font-weight: 700; }
.help ol { text-align: left; color: var(--muted); margin: 0; padding-left: 20px; line-height: 1.55; font-weight: 600; }
.help ol b { color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge), 0 12px 30px rgba(0,0,0,.4); border-radius: 99px; padding: 10px 18px; font-weight: 800; z-index: 30; animation: rise .3s ease; max-width: calc(100% - 32px); text-align: center; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.shake { animation: shake .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes reveal { 0% { transform: scale(.9); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- the two halves of the Activity: minigames and /pokemon ---------- */
.modes { display: flex; gap: 8px; padding: 14px 16px 0; }
.modes button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 800; font-size: 1rem; }
.modes button[aria-pressed="true"] { background: var(--raise); color: var(--ink); border-color: var(--muted); }
.modes .ball { width: 22px; height: 22px; }
.modes img { width: 30px; height: 30px; }
/* The Poké Ball mark, the one bit of red: greed's black and white, with the ball's top. */
.ball { position: relative; display: inline-block; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1.5px solid var(--ink);
  background: linear-gradient(var(--poke) 0 44%, var(--ink) 44% 56%, var(--bg) 56%); }
.ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); border: 1.5px solid var(--ink); }
.chrome .ball { width: 26px; height: 26px; border-color: #dbdee1; }

#adv[hidden], #mini[hidden] { display: none; }
#mini, #adv { display: flex; flex-direction: column; flex: 1; }
.advbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid transparent; background: none; border-radius: 99px; padding: 8px 14px; min-height: 40px; font-weight: 700; font-size: .92rem; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.tabs button.fight:not([aria-pressed="true"]) { border-color: var(--line); color: var(--ink); }
@media (max-width: 520px) { .purse { display: none !important; } }
.purse { flex: none; font-weight: 800; font-size: .92rem; color: var(--ink); padding: 0 4px; }
.advmain { padding-inline: 16px; padding-block: 16px 48px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.mocknote { display: flex; gap: 10px; align-items: flex-start; color: var(--faint); font-size: .84rem; font-weight: 600; line-height: 1.4; }
.mocknote b { color: var(--muted); }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.box > h3, .sect { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.box > h3 .sub, .sect .sub { color: var(--faint); font-weight: 600; font-size: .86rem; margin-left: auto; }
.hd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hd h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
.hd .sub { color: var(--faint); font-weight: 700; font-size: .92rem; }
button.back { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 8px 14px; min-height: 40px; font-weight: 700; color: var(--muted); }
.row2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 760px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }

/* trainer card */
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field { background: var(--raise); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.field .k { font-size: .76rem; font-weight: 700; color: var(--faint); }
.field .v { font-size: 1.06rem; font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }
.field .v small { font-size: .78rem; color: var(--muted); font-weight: 700; }
@media (max-width: 520px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slot { position: relative; border: 1px solid var(--line); background: var(--raise); border-radius: 14px; padding: 8px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; color: var(--ink); }
.slot:hover { border-color: var(--muted); }
.slot img { width: 56px; height: 56px; }
.slot b { font-size: .8rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .lv { font-size: .74rem; color: var(--muted); font-weight: 700; }
.slot.empty { border-style: dashed; color: var(--faint); justify-content: center; min-height: 100px; font-weight: 700; font-size: .82rem; }
.grade { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--line); color: var(--ink); }
.grade.g-S { background: var(--shiny); color: #0a0a0a; } .grade.g-A { background: var(--ink); color: #0a0a0a; }
.star { position: absolute; top: 6px; left: 7px; font-size: .78rem; color: var(--shiny); font-weight: 800; }
.bigbtn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 16px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.1rem; width: 100%; }
.bigbtn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.bigbtn.go { background: var(--right); border-color: var(--right); color: var(--right-ink); }
.bigbtn:disabled { opacity: .45; cursor: default; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .pill { flex: 1 1 auto; }
.pill.red { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.pill.redsolid { background: var(--bad); color: #fff; border-color: var(--bad); }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* the grass rustling, and things waiting for you */
.rustle { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; border-radius: 18px; padding: 14px 16px; border: 1px solid var(--grass-line); background: var(--grass); }
.rustle .leaf { font-size: 1.6rem; animation: sway 1.4s ease-in-out infinite; transform-origin: bottom center; }
.rustle b { display: block; font-size: 1rem; }
.rustle span { color: var(--muted); font-size: .86rem; font-weight: 600; }
.rustle .pill { margin-left: auto; }
.rustle.sparkle { border-color: color-mix(in srgb, var(--shiny) 60%, transparent); }
.rustle.sparkle .leaf { animation: twinkle 1s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-12deg); } }
@keyframes twinkle { 50% { opacity: .4; transform: scale(.85); } }
.inbox { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--raise); }
.inbox .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line); flex: none; }
.inbox .t { min-width: 0; flex: 1; font-size: .9rem; font-weight: 600; color: var(--muted); }
.inbox .t b { color: var(--ink); }

/* party */
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; }
.prow:hover { border-color: var(--muted); }
.prow img { width: 60px; height: 60px; }
.prow .nm { font-weight: 800; font-size: 1.04rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prow .nm .lv { color: var(--muted); font-weight: 700; font-size: .88rem; }
.prow .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; color: var(--faint); font-size: .8rem; font-weight: 700; }
.prow .ctl { display: flex; gap: 4px; }
.prow .ctl button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--raise); font-weight: 800; color: var(--muted); }
.prow .ctl button:disabled { opacity: .3; cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; background: var(--raise); border: 1px solid var(--line); font-size: .74rem; font-weight: 700; color: var(--muted); }
.tag img { width: 14px; height: 14px; }
.tag.lead { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--hp-hi); transition: width .45s ease, background .3s; }
.bar.xp i { background: var(--xp); }
.bar i.mid { background: var(--hp-mid); } .bar i.lo { background: var(--hp-lo); }
.prow .bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; margin-top: 6px; max-width: 320px; font-size: .7rem; font-weight: 700; color: var(--faint); }
@media (max-width: 520px) { .prow { grid-template-columns: 48px minmax(0, 1fr); } .prow img { width: 48px; height: 48px; } .prow .ctl { grid-column: 1 / -1; justify-content: flex-end; } }

/* PC */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: .88rem; min-height: 40px; }
.filters input { flex: 1 1 160px; min-width: 0; }
.pcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
@media (max-width: 520px) { .pcgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .pcgrid .slot img { width: 46px; height: 46px; } }
.slot .inparty { position: absolute; bottom: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

/* one Pokémon */
.monhead { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 640px) { .monhead { grid-template-columns: minmax(0, 1fr); } }
.pedestal { position: relative; border-radius: 22px; background: var(--stage); border: 1px solid var(--line); display: grid; place-items: center; padding: 18px; min-height: 230px; overflow: hidden; }
.pedestal::before { content: ""; position: absolute; inset: 0; background: var(--stage-glow); }
.pedestal img { position: relative; width: min(190px, 52vw); height: min(190px, 52vw); animation: bob 3s ease-in-out infinite; }
.pedestal .shinytag { position: absolute; top: 12px; left: 12px; }
.pedestal .grade { top: 12px; right: 12px; min-width: 30px; height: 30px; font-size: .95rem; border-radius: 9px; }
.monname { font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; margin: 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv > div { background: var(--raise); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.kv .k { font-size: .74rem; font-weight: 700; color: var(--faint); }
.kv .v { font-weight: 800; font-size: .95rem; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.kv .v img { width: 22px; height: 22px; }
.stats { display: grid; grid-template-columns: 72px minmax(0, 1fr) 40px 54px; gap: 8px 10px; align-items: center; font-size: .9rem; }
.stats .n { font-weight: 700; color: var(--muted); }
.stats .n .up { color: var(--hp-lo); } .stats .n .dn { color: var(--g3); }
.stats .num { font-weight: 800; text-align: right; }
.stats .iv { font-size: .74rem; color: var(--faint); font-weight: 700; text-align: right; }
.stats .bar { height: 10px; }
.stats .bar i { background: var(--ink); opacity: .85; }
.movegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .movegrid { grid-template-columns: minmax(0, 1fr); } }
.mv { position: relative; text-align: left; border: 1px solid var(--line); background: var(--raise); border-radius: 14px; padding: 10px 12px 10px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden; color: var(--ink); }
.mv::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tc, var(--line)); }
.mv b { font-size: 1rem; font-weight: 800; }
.mv .d { font-size: .78rem; font-weight: 700; color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mv .pp { position: absolute; top: 10px; right: 12px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.mv .fx { font-size: .76rem; font-weight: 800; }
.fx.super { color: var(--hp-hi); } .fx.weak { color: var(--hp-mid); } .fx.none { color: var(--hp-lo); }
.mv:disabled { opacity: .45; cursor: default; }
button.mv:hover:not(:disabled) { border-color: var(--tc); transform: translateY(-1px); }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--bad) 50%, var(--line)); }
.confirm span { flex: 1 1 180px; font-weight: 700; }

/* bag and shop */
.items { display: flex; flex-direction: column; gap: 6px; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--raise); }
.item .ic { width: 36px; height: 36px; display: grid; place-items: center; }
.item .ic img { width: 30px; height: 30px; image-rendering: pixelated; object-fit: contain; }
.item b { font-weight: 800; }
.item .d { color: var(--faint); font-size: .8rem; font-weight: 600; margin-top: 2px; }
.item .cnt { color: var(--muted); font-weight: 800; margin-left: 6px; }
.item .ctl { display: flex; align-items: center; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; }
.qty button { width: 34px; height: 34px; border: 0; background: none; font-weight: 800; color: var(--muted); }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }
@media (max-width: 520px) { .item { grid-template-columns: 34px minmax(0, 1fr); } .item .ctl { grid-column: 2; justify-content: flex-start; } }

/* the battle picker */
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .ways { grid-template-columns: minmax(0, 1fr); } }
.way { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; color: var(--ink); min-width: 0; }
.way:hover:not(:disabled) { border-color: var(--muted); }
.way:disabled { opacity: .45; cursor: default; }
.way .ic { grid-row: span 2; font-size: 1.6rem; display: grid; place-items: center; }
.way .ic img { width: 44px; height: 44px; }
.way b { font-size: 1.05rem; font-weight: 800; }
.way span { color: var(--faint); font-size: .84rem; font-weight: 600; line-height: 1.35; }
.way .pays { color: var(--muted); }

/* the battle */
.battle { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .battle { grid-template-columns: minmax(0, 1fr); } }
.arena { position: relative; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; aspect-ratio: 16 / 10; max-width: 100%; background: var(--arena); }
.arena.wild { background: var(--arena-wild); }
.arena.elite { background: var(--arena-elite); }
@media (max-width: 520px) { .arena { aspect-ratio: 4 / 4.2; } }
.arena .horizon { position: absolute; left: 0; right: 0; top: 52%; height: 1px; background: var(--line); opacity: .6; }
.arena .pad { position: absolute; border-radius: 50%; background: var(--pad); }
.arena .pad.foe { right: 9%; top: 38%; width: 34%; height: 13%; }
.arena .pad.me { left: 5%; bottom: 7%; width: 40%; height: 14%; }
.arena img.fmon { position: absolute; image-rendering: pixelated; object-fit: contain; transition: opacity .4s, transform .4s; }
.arena img.foe { right: 13%; top: 10%; width: 26%; aspect-ratio: 1; }
.arena img.me { left: 9%; bottom: 10%; width: 32%; aspect-ratio: 1; transform: scaleX(-1); }
.arena img.hit { animation: hit .45s steps(2) 1; }
.arena img.me.hit { animation: hitme .45s steps(2) 1; }
.arena img.down { opacity: 0; transform: translateY(30%); }
.arena img.me.down { transform: scaleX(-1) translateY(30%); }
.arena img.inball { opacity: 0; transform: scale(.2); }
.arena img.thrown { position: absolute; right: 22%; top: 24%; width: 7%; aspect-ratio: 1; image-rendering: pixelated; animation: throwball .5s ease-out; }
.arena img.thrown.wobble { animation: wobble .6s ease-in-out 3; }
@keyframes hit { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes hitme { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes throwball { from { transform: translate(-300%, 250%) rotate(-360deg); } }
@keyframes wobble { 25% { transform: rotate(-22deg); } 75% { transform: rotate(22deg); } }
.hpbox { position: absolute; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; width: min(46%, 260px); display: flex; flex-direction: column; gap: 5px; }
.hpbox.foe { left: 4%; top: 6%; }
.hpbox.me { right: 4%; bottom: 8%; }
.hpbox .top { display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; }
.hpbox b { font-weight: 800; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hpbox .lv { margin-left: auto; color: var(--muted); font-weight: 700; font-size: .8rem; flex: none; }
.hpbox .hpn { font-size: .78rem; font-weight: 800; color: var(--muted); text-align: right; }
.hpbox .balls { display: flex; gap: 3px; }
.hpbox .balls i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.hpbox .balls i.out { background: var(--line); }
@media (max-width: 520px) { .hpbox { width: 58%; padding: 6px 10px; } .hpbox.me { bottom: 4%; } .arena img.me { bottom: 22%; width: 36%; } .arena .pad.me { bottom: 19%; } .arena img.foe { top: 20%; width: 30%; right: 8%; } .arena .pad.foe { top: 45%; right: 5%; } .hpbox.foe { top: 4%; } }
.turnline { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.turnline b { color: var(--ink); }
.timer { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.cmd { display: flex; flex-direction: column; gap: 10px; }
.cmdtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cmdtabs .pill { flex: 1 1 0; }
.swlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .swlist { grid-template-columns: minmax(0, 1fr); } }
.sw { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--raise); border-radius: 14px; padding: 8px 10px; color: var(--ink); }
.sw img { width: 44px; height: 44px; grid-row: span 2; }
.sw b { font-weight: 800; font-size: .92rem; }
.sw:disabled { opacity: .4; cursor: default; }
.sw.out { border-color: var(--muted); }
.log { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; font-size: .88rem; line-height: 1.4; }
@media (max-width: 860px) { .log { max-height: 260px; } }
.log .t { color: var(--faint); font-weight: 800; font-size: .76rem; margin-top: 4px; }
.log p { margin: 0; color: var(--muted); font-weight: 600; }
.log p b { color: var(--ink); }
.log p .s1 { color: var(--ink); } .log p .s2 { color: var(--bad); }
.log p.fresh { animation: rise .3s ease; }
.side1, .side2 { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.side1 { background: var(--g3); } .side2 { background: var(--bad); }

/* region bars on the Pokédex */
.regions { display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; gap: 8px 12px; align-items: center; font-size: .9rem; font-weight: 700; }
.regions .n { color: var(--muted); }
.regions .c { text-align: right; color: var(--faint); }
.board5 { display: flex; flex-direction: column; gap: 6px; }
.board5 > div { display: grid; grid-template-columns: 28px 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--raise); font-weight: 700; }
.board5 .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 800; }
.board5 .me { outline: 1px solid var(--muted); }

/* the trade window */
.tradewin { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 10px; align-items: stretch; }
@media (max-width: 560px) { .tradewin { grid-template-columns: minmax(0, 1fr); } .tradewin .arrows { min-height: 28px; } }
.tside { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.tside.ready { border-color: var(--right); }
.tside img { width: 110px; height: 110px; }
.tside .who { background: none; border: 0; padding: 0; color: var(--faint); font-weight: 700; font-size: .84rem; }
.arrows { display: grid; place-items: center; font-size: 1.4rem; color: var(--faint); }
.pickcard { width: min(520px, 100%); max-height: calc(100vh - 80px); overflow: hidden; }
.pickcard .plist { overflow-y: auto; width: 100%; text-align: left; max-height: 55vh; }
/* ---------- the real Activity's extras ---------- */
.starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.starter { display: grid; justify-items: center; gap: 8px; padding: 18px 10px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; min-width: 0; }
.starter:hover { border-color: var(--ink); }
.starter img { width: auto; height: 110px; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.starter img.ani { height: 104px; width: auto; }
.starter b { font-size: 1.05rem; }
.starter span { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 520px) { .starters { gap: 8px; } .starter { padding: 12px 4px; } .starter img { height: 72px; } }
.waiting { display: grid; justify-items: center; gap: 10px; padding: 64px 16px; text-align: center; color: var(--muted); }
.waiting p { margin: 0; max-width: 46ch; }
.conn { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--close); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.pedestal img.ani { width: auto; height: auto; max-width: 70%; max-height: 70%; image-rendering: pixelated; }
.sdhost { display: block; }

.tbadge { width: 18px; height: 18px; border-radius: 50%; border: 1px dashed var(--line); display: inline-grid; place-items: center; font-size: 11px; color: var(--muted); }
.tbadge.got { border-style: solid; border-color: transparent; }
.tbadge.easy, .gymbadge.easy i { background: radial-gradient(circle at 35% 30%, #e8b48a, #9a5a2c); }
.tbadge.medium, .gymbadge.medium i { background: radial-gradient(circle at 35% 30%, #f4f4f4, #8d8d8d); }
.tbadge.hard, .gymbadge.hard i { background: radial-gradient(circle at 35% 30%, #fff1a8, #b8911e); }
.tbadge.crown { background: none; border: 0; color: var(--shiny); font-size: 15px; }
.gymbadges, .cardbadges { display: flex; gap: 8px; flex-wrap: wrap; }
.cardbadges { margin: 2px 0 10px; }
.gymbadge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; color: var(--faint); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 4px; }
.gymbadge i { width: 16px; height: 16px; border-radius: 50%; border: 1px dashed var(--line); background: none; }
.gymbadge.got { color: var(--ink); }
.gymbadge.got i { border: 0; }
.gymbadge small { font-weight: 600; color: var(--faint); }

/* ---------- the town: a Game Boy Advance screen ---------- */
.world { display: grid; justify-items: center; gap: 14px; }
.worldscreen { --px: 3px; position: relative; padding: 0; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 0 0 6px #1c1c1e, 0 0 0 8px #3a3a3e, 0 12px 40px rgba(0,0,0,.5); max-width: 100%; }
.worldscreen canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.worldtext { position: absolute; left: calc(var(--px) * 3); right: calc(var(--px) * 3); bottom: calc(var(--px) * 3); min-height: calc(var(--px) * 30); padding: calc(var(--px) * 5) calc(var(--px) * 7); background: #fbfbfb; color: #3c3c44; border-radius: calc(var(--px) * 4); box-shadow: inset 0 0 0 var(--px) #4a4a52, inset 0 0 0 calc(var(--px) * 2) #fbfbfb, inset 0 0 0 calc(var(--px) * 3) #d6d6dc; font: 700 calc(var(--px) * 7) / 1.5 "Pixelify Sans", monospace; letter-spacing: .02em; cursor: pointer; user-select: none; }
.worldtext .txt { text-shadow: calc(var(--px) * .5) calc(var(--px) * .5) 0 #d0d0d8; }
.worldtext .more { position: absolute; right: calc(var(--px) * 6); bottom: calc(var(--px) * 3); color: #e85848; font-size: calc(var(--px) * 5); opacity: 0; }
.worldtext.done .more { opacity: 1; animation: worldbob .6s steps(2) infinite; }
@keyframes worldbob { 50% { transform: translateY(calc(var(--px) * 1.5)); } }
.worldmenu { position: absolute; right: calc(var(--px) * 3); bottom: calc(var(--px) * 36); display: grid; padding: calc(var(--px) * 4) calc(var(--px) * 6) calc(var(--px) * 4) calc(var(--px) * 10); background: #fbfbfb; border-radius: calc(var(--px) * 4); box-shadow: inset 0 0 0 var(--px) #4a4a52, inset 0 0 0 calc(var(--px) * 2) #fbfbfb, inset 0 0 0 calc(var(--px) * 3) #d6d6dc; }
.worldmenu button { position: relative; text-align: left; border: 0; background: none; padding: calc(var(--px) * 1.5) 0; color: #404048; font: 700 calc(var(--px) * 7) / 1.3 "Pixelify Sans", monospace; cursor: pointer; white-space: nowrap; }
.worldmenu button.off { color: #a8a8b0; }
.worldmenu button.on::before { content: "▶"; position: absolute; left: calc(var(--px) * -7); top: calc(var(--px) * 1.5); color: #404048; font-size: calc(var(--px) * 5.5); }
.worldplace { position: absolute; left: calc(var(--px) * 4); top: calc(var(--px) * -24); padding: calc(var(--px) * 3) calc(var(--px) * 8); background: #2c2c32; color: #f4f4f6; border-radius: calc(var(--px) * 2); box-shadow: inset 0 0 0 var(--px) #6a6a72, inset 0 0 0 calc(var(--px) * 2) #2c2c32; font: 700 calc(var(--px) * 6.5) / 1.2 "Pixelify Sans", monospace; letter-spacing: .06em; pointer-events: none; }
.worldplace.show { animation: worldplace 2.6s ease both; }
@keyframes worldplace { 0% { top: calc(var(--px) * -24); } 12%, 82% { top: calc(var(--px) * 4); } 100% { top: calc(var(--px) * -24); } }
.worldhelp { color: var(--faint); font-size: .85rem; text-align: center; }
.worldcredit { color: var(--faint); font-size: .75rem; text-align: center; opacity: .8; }
.worldpad { display: none; width: min(100%, 420px); justify-content: space-between; align-items: center; padding: 6px 10px; user-select: none; touch-action: none; }
@media (hover: none), (pointer: coarse), (max-width: 520px) { .worldpad { display: flex; } .worldhelp { display: none; } }
.worldpad .dpad { position: relative; width: 132px; height: 132px; }
.worldpad .dpad button { position: absolute; width: 44px; height: 44px; border: 0; background: #2c2c3a; border-radius: 6px; box-shadow: inset 0 -3px 0 #1a1a24; touch-action: none; }
.worldpad .dpad span { position: absolute; left: 44px; top: 44px; width: 44px; height: 44px; background: #2c2c3a; }
.worldpad .dpad [data-k="up"] { left: 44px; top: 0; } .worldpad .dpad [data-k="down"] { left: 44px; top: 88px; }
.worldpad .dpad [data-k="left"] { left: 0; top: 44px; } .worldpad .dpad [data-k="right"] { left: 88px; top: 44px; }
.worldpad .dpad button:active, .worldpad .ab button:active { filter: brightness(1.4); }
.worldpad .ab { display: flex; gap: 14px; align-items: center; transform: rotate(-18deg); }
.worldpad .ab button { width: 62px; height: 62px; border-radius: 50%; border: 0; font: 800 22px "Pixelify Sans", monospace; color: #f8f8f8; touch-action: none; }
.worldpad .ab [data-k="a"] { background: #c83848; box-shadow: inset 0 -4px 0 #8a2030; margin-top: -24px; }
.worldpad .ab [data-k="b"] { background: #5a5a6a; box-shadow: inset 0 -4px 0 #3a3a48; margin-top: 24px; }
.worldtext[hidden], .worldmenu[hidden] { display: none; }

/* ---------- the game: the world, with windows in its place ---------- */
#adv { padding-block: 14px 28px; padding-inline: 12px; }
.conn { position: fixed; top: 10px; right: 12px; z-index: 20; margin: 0; background: var(--panel); }
.worldscreen { width: 100%; min-height: 220px; }
/* The game uses the whole window; the Game Corner's pages stay a readable width. */
.frame:has(#adv:not([hidden])) { max-width: none; }
#mini { width: 100%; max-width: 960px; margin-inline: auto; }
.worldscreen canvas[hidden] { display: none; }
.worldmenubtn { position: absolute; top: calc(var(--px) * 4); right: calc(var(--px) * 4); z-index: 3; border: 0; border-radius: calc(var(--px) * 2); padding: calc(var(--px) * 1.5) calc(var(--px) * 5); background: rgba(28,28,34,.82); color: #f4f4f6; font: 700 max(12px, calc(var(--px) * 5.5)) "Pixelify Sans", monospace; box-shadow: inset 0 0 0 var(--px) #6a6a72; cursor: pointer; }
.worldscreen:has(.worldwin:not([hidden])) .worldmenubtn, .worldscreen:has(.worldstart:not([hidden])) .worldmenubtn { display: none; }
/* The menu: a list down the right, like the games'. */
.worldstart { position: absolute; top: calc(var(--px) * 4); right: calc(var(--px) * 4); z-index: 4; display: grid; min-width: calc(var(--px) * 70); padding: calc(var(--px) * 4) calc(var(--px) * 6) calc(var(--px) * 4) calc(var(--px) * 10); background: #fbfbfb; border-radius: calc(var(--px) * 4); box-shadow: inset 0 0 0 var(--px) #4a4a52, inset 0 0 0 calc(var(--px) * 2) #fbfbfb, inset 0 0 0 calc(var(--px) * 3) #d6d6dc; }
.worldstart button { position: relative; text-align: left; border: 0; background: none; padding: calc(var(--px) * 1.6) 0; color: #3c3c44; font: 700 max(12px, calc(var(--px) * 7)) / 1.3 "Pixelify Sans", monospace; cursor: pointer; white-space: nowrap; }
.worldstart button.on::before { content: "▶"; position: absolute; left: calc(var(--px) * -7); top: calc(var(--px) * 1.8); color: #3c3c44; font-size: calc(var(--px) * 5.5); }
.worldstart[hidden] { display: none; }
/* A window: in the world's place, at least as big as it, as tall as it needs. */
.worldwin { position: relative; min-height: var(--h, 576px); background: var(--bg-art), var(--bg); background-attachment: local; display: flex; flex-direction: column; }
.worldwin[hidden] { display: none; }
.winbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px 0; }
.winbar button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 99px; min-height: 38px; padding: 4px 14px; font-weight: 700; }
.winbar .winx { margin-left: auto; min-width: 38px; padding: 0; }
.winbar button[hidden] { display: none; }
.worldwin .advmain { padding-block: 8px 24px; }
.worldpad .ab [data-k="menu"] { width: 44px; height: 44px; font-size: 18px; background: #2c2c3a; box-shadow: inset 0 -3px 0 #1a1a24; align-self: flex-start; margin-top: -40px; }
/* The Game Corner's bar over the minigames. */
.minibar { display: flex; align-items: center; gap: 12px; padding: 12px 16px 0; }

/* ---------- making your trainer ---------- */
.creator { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 620px) { .creator { grid-template-columns: minmax(0, 1fr); } }
.lookprev { display: grid; justify-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; position: sticky; top: 56px; }
.lookprev canvas { width: 192px; height: 192px; image-rendering: pixelated; background: radial-gradient(circle at 50% 70%, #9fd38c 0 40%, #7ec870 41% 100%); border-radius: 14px; }
.lookprev .spin { display: flex; gap: 8px; }
.lookprev .spin button { border: 1px solid var(--line); background: var(--raise); color: var(--ink); border-radius: 99px; width: 42px; height: 42px; font-size: 18px; }
.lookside { display: grid; gap: 14px; min-width: 0; }
.lookbases { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lookbase { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 6px 10px 6px 6px; text-align: left; font-weight: 700; font-size: .85rem; min-height: 48px; }
.lookbase[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.lookbase canvas { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.lookbase.small { font-size: .78rem; }
.lookrow { display: grid; gap: 6px; }
.lookrow b { font-size: .9rem; }
.lookrow .sw { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); padding: 0; color: var(--muted); background: var(--panel); font-weight: 800; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.lookmore summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 0; }
.lookclassic { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 8px; }

/* ---------- settings ---------- */
.keys { display: grid; gap: 6px; margin-bottom: 10px; }
.keyrow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 8px; align-items: center; }
@media (max-width: 520px) { .keyrow { grid-template-columns: minmax(0, 1fr) 84px 84px; } }
.keycap { border: 1px solid var(--line); border-bottom-width: 3px; background: var(--raise); color: var(--ink); border-radius: 10px; min-height: 40px; font: 700 .9rem "Pixelify Sans", monospace; }
.keycap.wait { border-color: var(--ink); animation: worldbob .6s steps(2) infinite; }
.optrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }

/* ---------- watching somebody in the Game Corner: their board, look but don't touch ---------- */
.mirror { position: relative; transform: translateZ(0); overflow: hidden; contain: paint; pointer-events: none; user-select: none; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 12px; }
.mirror .mirrorinput { display: block; border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px; min-height: 44px; color: var(--ink); background: var(--panel); }
.mirror #m-whoWrong .chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 4px; }
.mirror #m-whoWrong img { width: 26px; height: 26px; }
.mirror #m-hlHigher { background: var(--right); color: var(--right-ink); }
.mirror #m-hlLower { background: var(--bad); }

/* ---------- grades, E to S ---------- */
.grade-big { display: inline-grid; place-items: center; min-width: 1.6em; padding: 0 .25em; border-radius: 12px; font-weight: 900; line-height: 1.3; vertical-align: middle; background: var(--raise); color: var(--ink); border: 2px solid var(--line); }
.grade-big.g-S { background: #f2c94c; color: #2a1d00; border-color: #f7dc85; }
.grade-big.g-A { background: #36a361; color: #fff; border-color: #5cc184; }
.grade-big.g-B { background: #3b82c4; color: #fff; border-color: #64a2db; }
.grade-big.g-C { background: #8a5cc6; color: #fff; border-color: #a881dc; }
.grade-big.g-D { background: #6b6b6b; color: #fff; }
.grade-big.g-E { background: #3a3a3a; color: #ddd; }
.reveal .grade-big { font-size: 1.6rem; margin: 6px 0; }
