:root {
  --text: #ffffff; --muted: #dbeaff; --accent: #ffd400; --ink: #14142b; --line: #0b0b1e; --panel: #ffffff24; --panel2: #ffffff38; --paper: #fffdf2;
  --Common: #cfc4e6; --Uncommon: #7cc7ff; --Rare: #b98af5; --SuperRare: #ff5a36; --UltraRare: #9b30ff; --Legendary: #ffc93c; --Shiny: #ffffff;
  --rainbow: #ff8fc7, #ffd36e, #a8f0c6, #8fd3ff, #c9a6ff, #ff8fc7;
  --candy: linear-gradient(120deg, #ffe14d, #ffb300);
  /* The rest of what a theme sets (see THEMES in app.js) : --deep behind everything, --bg the page, --bar the top bar, --pop the shadow of the titles,
     --dialog the windows and the drawer, --on-candy the text of a highlighted button */
  --deep: #0b3c8f; --bar: #0b3c8fe6; --pop: #0b0b1e; --dialog: linear-gradient(160deg, #1766d6, #0b3c8f); --on-candy: #14142b;
  /* Halftone dots of a printed comic over a blue sky */
  --bg: radial-gradient(#ffffff2e 2.5px, transparent 3px) 0 0 / 22px 22px, linear-gradient(160deg, #2a93ff, #1766d6 50%, #0b3c8f) fixed;
  /* Titles, buttons and names are lettered like a comic strip */
  --comic: "Comic Sans MS", "Chalkboard SE", "Comic Neue", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; background: var(--deep); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.45 "Arial Rounded MT Bold", "Segoe UI Rounded", "Nunito", "Trebuchet MS", system-ui, sans-serif; overflow-wrap: break-word;
  background: var(--bg); }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1 { margin: 0; font: 800 clamp(24px, 4vw, 30px)/1.2 var(--comic); text-shadow: 2px 3px 0 var(--pop); text-wrap: balance; }
h2 { margin: 0 0 12px; font: 800 19px/1.3 var(--comic); }
.sub { margin: 4px 0 0; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 10px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Shell : a bar at the top with the burger, the logo, the wallet and the player ; the pages wait in a drawer on the left */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 18px; border-bottom: 3px solid var(--line); background: var(--bar); backdrop-filter: blur(8px); }
.burger { position: relative; width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.burger[aria-expanded=true] { background: var(--candy); border-color: var(--on-candy); color: var(--on-candy); }
/* Something waits in the drawer : messages, friend requests or exchanges */
.burger.alert::after { content: ""; position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #e6261f; }
/* Logo : lettered like the title card of a cartoon, an ink outline under the letters */
.logo { font: italic 800 25px/1 var(--comic); text-transform: uppercase; color: var(--accent); text-decoration: none; -webkit-text-stroke: 5px #0b0b1e; paint-order: stroke fill; text-shadow: 2px 3px 0 #0b0b1e; rotate: -2deg; }
.logo span { color: #ff5a36; }
.nav { position: fixed; inset: 0 auto 0 0; z-index: 25; width: min(280px, 86vw); display: flex; flex-direction: column; gap: 8px; padding: 84px 16px 20px; overflow-y: auto;
  background: var(--dialog); border-right: 3px solid var(--accent); box-shadow: 0 0 0 100vmax #05102e00;
  visibility: hidden; transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility .25s, box-shadow .25s; }
/* The shadow dims the page behind the open drawer */
.nav.open { visibility: visible; transform: none; box-shadow: 0 0 0 100vmax #05102eaa; }
.nav a.item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel2); color: var(--text);
  text-decoration: none; font-weight: 700; box-shadow: 3px 4px 0 #000c; }
.nav a.item:hover { border-color: #fff; translate: 0 -1px; }
.nav a.item[aria-current] { background: var(--candy); border-color: var(--on-candy); color: var(--on-candy); }
.nav a.item i { width: 24px; text-align: center; font-style: normal; }
.topbar .me { display: flex; align-items: center; gap: 10px; }
.topbar .me .who { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; }
.topbar .me .user { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
/* Profile picture : the top of the illustration of a card, where the faces are */
.avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 2px solid #fff3b0; background: var(--candy); color: #fff; font-size: 17px; font-weight: 800; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.topbar .me button { min-height: 34px; padding: 4px 12px; font-size: 13px; }
/* A shiny copy as profile picture : its rainbow ring, its foil over the face, and its number under the big picture */
.avatar.shiny { position: relative; overflow: visible; border: 3px solid transparent; box-shadow: 0 0 10px #ff8fc7aa, 0 0 18px #8fd3ff88;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, var(--rainbow)) 0 0 / 300% 100% border-box; animation: holo 2s linear infinite; }
.avatar.shiny img { border-radius: 50%; }
.avatar.shiny::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: color-dodge; opacity: .5; background: linear-gradient(115deg, var(--rainbow), #ffd36e); background-size: 300% 300%; animation: foil 4.5s linear infinite; }
.avatar.big.shiny::after { content: attr(data-serial); position: absolute; left: 50%; bottom: -10px; translate: -50% 0; rotate: -6deg; padding: 0 6px; border: 2px solid #b8860b; border-radius: 6px;
  background: #fffaf0; color: #7a5a00; font-size: 10px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav .dot, button .dot { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: #c4161c; font-size: 12px; font-weight: 800; text-align: center; }
.wallet { margin-left: auto; display: flex; gap: 8px; }
.pill { background: var(--panel); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
main { max-width: 1180px; margin: 0 auto; padding: 14px 18px 40px; }
main:focus { outline: none; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin: 0 0 20px; }
footer.site { margin-top: 56px; padding-top: 18px; border-top: 3px solid var(--line); color: var(--muted); font-size: 13px; text-align: left; }
footer.site ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; padding: 0; list-style: none; }
footer.site a { display: inline-block; padding: 4px 0; }

/* Controls */
button, a.button { font: inherit; font-family: var(--comic); font-weight: 700; min-height: 40px; cursor: pointer; border-radius: 999px; border: 2px solid var(--line); background: var(--panel2); color: var(--text); padding: 6px 18px; box-shadow: 3px 4px 0 #000c; }
button:hover:not(:disabled), a.button:hover { border-color: #fff; translate: 0 -1px; }
button:active:not(:disabled) { translate: 0 3px; box-shadow: 1px 1px 0 #000c; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, button[aria-pressed=true]:not(.card, .chip) { background: var(--candy); border-color: var(--on-candy); color: var(--on-candy); }
button.danger { border-color: #ffb4ae; }
button.danger:hover:not(:disabled) { background: #a3143f; }
/* A link that looks like a button, to another page */
a.button { display: inline-flex; align-items: center; text-decoration: none; }
button.ghost { background: none; border-style: dashed; box-shadow: none; }
select, input[type=search], input[type=text], input[type=number], input[type=password], input[type=email] { font: inherit; color: var(--ink); min-height: 40px; min-width: 0; border-radius: 14px; border: 2px solid #0b0b1e; background: #fff; padding: 6px 14px; }
input::placeholder { color: #6a6a85; opacity: 1; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
label { font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 240px; }
.toolbar label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { --c: var(--text); min-height: 34px; padding: 3px 14px; font-size: 14px; border-color: var(--c); color: var(--c); background: var(--panel); }
.chip[aria-pressed=true] { background: var(--c); color: var(--deep); }
/* A rarity chip keeps the colour of its rarity whatever the theme : on a dark ground, readable on a light page too */
.chip[class*="r-"] { background: #14142bd9; }
.chip[class*="r-"][aria-pressed=true] { background: var(--c); border-color: #fff; color: var(--ink); }
.chip.r-UltraRare { color: #d9b8ff; }
.chip.r-UltraRare[aria-pressed=true] { color: #fff; }
.chip small { margin-left: 5px; font-variant-numeric: tabular-nums; }
.pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel { background: var(--panel); border: 3px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 4px 5px 0 #0006; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.warn { padding: 12px 16px; border: 2px solid #ffd36e; border-radius: 14px; background: #4a2a10cc; color: #ffe7a8; }

/* Card. --c is the colour of the rarity */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
ul.grid { list-style: none; margin: 0; padding: 0; }
.grid > li { display: grid; min-width: 0; }
.card { --c: var(--Common); position: relative; display: flex; flex-direction: column; aspect-ratio: 5 / 8; min-width: 0; min-height: 0; overflow: hidden; padding: 0; text-align: left; font-weight: 400; font-size: 13px;
  /* One layer of its own : its badges never show apart from it, through the back of a card turned over for instance */
  isolation: isolate;
  /* An ink line around the frame, as around every drawing */
  border-radius: 14px; border: 4px solid var(--c); outline: 2px solid #0b0b1e; background: var(--paper); color: var(--ink); box-shadow: 5px 6px 0 #000c, 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
button.card { cursor: pointer; transition: transform .15s; }
button.card:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--c); translate: none; }
button.card:active:not(:disabled) { translate: none; box-shadow: 5px 6px 0 #000c, 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
.card.r-UltraRare::after, .card.r-Legendary::after, .card.r-Shiny::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, #fff7 50%, transparent 65%); background-size: 250% 100%; animation: shine 2.6s linear infinite; }
.card .cover { position: relative; display: flex; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: radial-gradient(circle at 30% 20%, #fff8, transparent 40%), linear-gradient(140deg, #ffd400, #2a93ff); }
.card img { width: 100%; height: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: 50% 18%; }
/* A channel is a logo and a series a title card or a poster : both shown whole on white. A character is cut around its face */
.card.k-Channel img { object-fit: contain; object-position: center; padding: 10px; background: #fff; }
.card.k-Show:not(.alt) img { object-fit: contain; object-position: center; background: #fff; }
/* No picture : the first letter of the card */
.card .nocover { flex: 1; display: grid; place-items: center; color: #fffa; font-size: 64px; font-weight: 800; }
.card .info { padding: 6px 10px 9px; width: 100%; min-width: 0; }
.card .title { font-family: var(--comic); font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .desc { color: #4a4a68; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .numbers { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .numbers > span:first-child { color: #0b56c4; }
.card .numbers > span:last-child { color: #c4161c; }
.badge, .tag { position: absolute; top: 8px; padding: 1px 8px; border-radius: 999px; font-weight: 800; font-size: 12px; border: 2px solid #fff; }
.badge { left: 8px; min-width: 30px; text-align: center; background: var(--c); color: var(--ink); }
.r-UltraRare > .badge, .badge.r-UltraRare { color: #fff; }
.tag { right: 8px; background: #14142be6; color: #fff; }
.tag.new { background: #e6261f; }
.star { position: absolute; top: 38px; right: 8px; padding: 0 6px; border-radius: 999px; background: #14142be6; color: #ffc93c; }
/* Shiny : a rarity apart, in limited edition, dressed as a cartoon of the golden age. The picture in sepia under film grain and a vignette, on old paper,
   in a gold frame that shines, the number of the copy stamped on it, the same sweep of light as an ultra rare card, and the card tips under the pointer (--rx and --ry, set by app.js) */
.card.r-Shiny { border: 7px solid transparent; color: #3b2a10; box-shadow: 4px 5px 0 #000c, 0 0 22px #f5b301aa;
  background: linear-gradient(#f3e6c4, #e8d5a6) padding-box, linear-gradient(120deg, #7a5a00, #ffe08a, #f5b301, #fff3c4, #b8860b, #7a5a00) 0 0 / 300% 100% border-box; animation: holo 3s linear infinite; }
.card.r-Shiny, button.card.r-Shiny:hover:not(:disabled) { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .15s; }
.card.r-Shiny img { filter: grayscale(1) sepia(.75) contrast(1.3) brightness(.95); }
.card.r-Shiny .cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse, transparent 55%, #2a1a0080), repeating-linear-gradient(90deg, #0000 0 37px, #3b2a1022 37px 38px);
  animation: grain .25s steps(2) infinite; }
.card.r-Shiny .desc { color: #6b5320; }
.card.r-Shiny .badge, .chip.r-Shiny[aria-pressed=true] { background: linear-gradient(120deg, #b8860b, #ffe08a, #f5b301); color: var(--ink); }
/* Number of the copy, stamped at the foot of the picture */
.card .stamp { position: absolute; z-index: 2; right: 6px; bottom: 8px; padding: 1px 8px; rotate: -8deg; border: 2px solid #b8860b; border-radius: 6px; background: #fffaf0e6; color: #7a5a00; font-size: 11px; font-weight: 800; letter-spacing: .05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Alt version : the other picture takes the whole card, the text is written over its foot */
.card.alt .cover { position: absolute; inset: 0; }
.card.alt .info { position: relative; margin-top: auto; padding-top: 34px; color: #fff; background: linear-gradient(transparent, #14142bd9 45%); text-shadow: 0 1px 3px #000; }
.card.alt .desc { color: #fff3b0; }
.card.alt .numbers > span { color: #fff; }
.card.alt .badge, .card.alt .tag, .card.alt .star, .card.alt .altmark { z-index: 1; }
.altmark { position: absolute; top: 36px; left: 8px; padding: 0 8px; border-radius: 999px; border: 2px solid #fff; background: linear-gradient(120deg, #e6261f, #ff8a00); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.card.missing { box-shadow: none; border-style: dashed; }
.card.missing .cover { filter: grayscale(1) brightness(.5); }
.card.missing::after { display: none; }
.card.selected { outline: 5px solid #fff; outline-offset: 2px; }
.card.selected::before { content: "✓"; position: absolute; z-index: 2; top: 68px; left: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e6261f; color: #fff; font-weight: 900; }

/* View by series : one section per series */
.groups section { margin-bottom: 30px; }
.groups h2 { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin: 0 0 12px; font-size: 22px; text-shadow: 2px 2px 0 var(--pop); }
.groups h2 small { font-size: 14px; font-weight: 400; color: var(--muted); text-shadow: none; }
.groups .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 168px)); }

/* Dialog */
dialog { border: 3px solid var(--accent); border-radius: 24px; background: var(--dialog); color: var(--text); padding: 22px; width: min(720px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: #05102ecc; }
/* Detail of a card : the card on the left, on the right what it is, its numbers, then what can be done with it */
.cardDialog { position: relative; width: min(780px, calc(100vw - 24px)); padding: 28px; }
.cardDialog .close { position: absolute; top: 12px; right: 12px; width: 40px; min-height: 40px; padding: 0; }
.detail { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-items: flex-start; }
.detail .card { width: min(260px, 64vw); flex: none; rotate: -2deg; }
.detail .side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kicker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-right: 44px; }
.kicker .badge { position: static; padding: 3px 12px; font-size: 13px; }
.kicker .chip { display: inline-flex; align-items: center; border-radius: 999px; border: 2px solid var(--line); background: var(--panel2); color: var(--text); font-size: 13px; font-weight: 700; }
.detail h2 { font-size: clamp(24px, 4vw, 32px); line-height: 1.1; margin: 0; overflow-wrap: anywhere; text-shadow: 2px 3px 0 var(--pop); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 0; }
.tiles > div { padding: 10px 6px; border-radius: 18px; border: 2px solid var(--line); background: var(--panel); text-align: center; }
.tiles dd { margin: 0; font-size: 20px; font-weight: 800; }
.tiles dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.detail .more { font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cardDialog .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.cardDialog .actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 8px; border-radius: 18px; font-size: 13px; line-height: 1.2; }
.cardDialog .actions .glyph { font-size: 24px; }
.cardDialog .actions button.on { background: var(--candy); border-color: var(--on-candy); color: var(--on-candy); }
.detail .discard { align-self: flex-start; min-height: 34px; padding: 4px 14px; font-size: 13px; background: none; box-shadow: none; }
.sell { display: grid; gap: 6px; padding: 14px; border: 2px dashed var(--line); border-radius: 18px; }
.sell small, .field small { color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
/* Small picture of a pack, in the colours of its kind */
.packart { width: 96px; aspect-ratio: 7 / 12; flex: none; display: grid; place-content: center; justify-items: center; gap: 6px; border-radius: 6px; color: #fff; text-shadow: 0 2px 0 #0006;
  border-top: 10px solid #fff3b0; border-bottom: 8px solid #fff3b0; background: radial-gradient(#fff7 10%, transparent 11%) 0 0 / 22px 22px, linear-gradient(150deg, var(--p1), var(--p2) 45%, var(--p3)); box-shadow: 4px 5px 0 #000c; }
.packart span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; background: #ffffff33; font-size: 20px; }
.packart b { font-size: 12px; }
.rule { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 10px 0 16px; padding: 0; list-style: none; }
.rule li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--panel2); font-size: 13px; }
.rule .badge { position: static; flex: none; }

/* Legal pages */
.prose { max-width: 74ch; }
.prose h2 { margin: 30px 0 8px; font-size: 19px; }
.prose ul { padding-left: 22px; }
.prose dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; margin: 0; }
.prose dt { color: var(--muted); }
.prose dd { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--panel2); }
.scroll { overflow-x: auto; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; width: max-content; max-width: calc(100vw - 24px); background: #7a1030; border: 2px solid #ffb4ae; color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: 3px 4px 0 #000c; }
#toast.ok { background: #0b56c4; border-color: #fff3b0; }

@keyframes grain { 50% { background-position: 0 0, 9px 0; } }
@keyframes holo { to { background-position: 0 0, 300% 0; } }
@keyframes foil { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* Phones and tablets : no burger, the pages sit in a bar at the bottom of the screen */
@media (max-width: 900px) {
  .topbar { position: static; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: none; backdrop-filter: none; }
  .topbar .burger, .topbar .me { display: none; }
  .nav { inset: auto 0 0 0; z-index: 20; width: auto; flex-direction: row; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: var(--deep);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); border-right: 0; border-top: 2px solid var(--line);
    visibility: visible; transform: none; transition: none; box-shadow: none; }
  .nav.open { box-shadow: none; }
  .nav a.item { flex: 1 0 74px; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; font-size: 11px; line-height: 1.2; text-align: center; border: 0; background: none; box-shadow: none; border-radius: 14px; }
  .nav .dot { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  main { padding: 14px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .cardDialog { padding: 20px 16px; }
  .detail .card { rotate: none; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); border-radius: 18px; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card .info { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .card, .pill, .panel, button { border: 1px solid CanvasText; } }
