/* Cards, ribbons and Clubs (web/js/profile.js, ribbons.js, clubs.js, emblem.js). Pixel pictures are drawn by the game on canvases;
   the page only stretches them, so they stay sharp. */

.link-btn { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.link-btn:hover b { text-decoration: underline; }
canvas.ribbon-pic, canvas.emblem-pic, canvas.card-banner, canvas.banner-swatch, canvas.portrait-deco, canvas.emblem-grid { image-rendering: pixelated; }

/* ---- a card ---- */
.card-view { --accent: #17b566; position: relative; display: grid; gap: 0; border-radius: 16px; overflow: hidden; border: 2px solid var(--accent); background: #fffdf8; }
.card-banner { display: block; width: 100%; height: 96px; }
.card-head { position: relative; display: flex; gap: 12px; align-items: flex-end; padding: 0 14px; margin-top: -34px; }
.card-names { display: grid; gap: 2px; padding-bottom: 6px; min-width: 0; flex: 1; }
.card-name { margin: 0 !important; font-size: 21px; line-height: 1.15; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; text-shadow: 0 1px 0 #fffdf8, 0 0 6px #fffdf8; }
.card-pronouns { font-size: 12px; font-weight: 600; color: var(--muted); }
.card-title, .card-group { align-self: start; font-size: 12px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 10px; }
.card-role { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.card-status { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.card-body { padding: 8px 14px 10px; display: grid; gap: 4px; }
.card-body h3 { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card-bio { margin: 0; overflow-wrap: anywhere; }
.card-where { margin: 6px 0 0; font-size: 14px; }
.card-facts { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.card-club { display: flex; gap: 10px; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 6px 12px 6px 6px; cursor: pointer; text-align: left; margin-top: 6px; width: fit-content; max-width: 100%; }
.card-club span { display: grid; }
.card-club i { font-size: 12px; color: var(--muted); font-style: normal; }
.card-ribbons { display: flex; flex-wrap: wrap; gap: 8px; }
.card-ribbons.big { gap: 12px; }
.ribbon-tap { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; border-radius: 4px; }
.ribbon-tap:focus-visible { outline: 3px solid var(--accent, var(--green-deep)); outline-offset: 2px; }
.ribbon-tap[aria-pressed="true"] canvas { outline: 3px solid var(--green-deep); outline-offset: 2px; }
.card-ribbon-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-pets { display: flex; gap: 10px; flex-wrap: wrap; }
.card-pet { display: grid; justify-items: center; font-size: 12px; font-weight: 700; }
.card-stickers { display: flex; gap: 8px; }
.sticker { display: inline-flex; border: 2px dashed var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 14px; border-top: 2px solid var(--line); background: #faf5e6; }
.layout-wide .card-banner { height: 120px; }
.layout-wide .card-head { margin-top: -50px; }
.layout-showcase .card-banner { height: 56px; }
.layout-showcase .card-head { margin-top: -26px; }
.card-view.character .card-name { font-size: 22px; }

/* the portrait and its frame */
.portrait { position: relative; display: grid; place-items: center; background: #fffdf8; border: 3px solid var(--accent); flex: none; }
.portrait-face { image-rendering: pixelated; display: block; }
.portrait-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.portrait.f-round { border-radius: 50%; overflow: hidden; }
.portrait.f-square { border-radius: 6px; }
.portrait.f-tag { border-radius: 14px 14px 6px 6px; border-width: 4px; }
.portrait.f-tag::before { content: ""; position: absolute; top: 3px; left: 50%; width: 14px; height: 5px; margin-left: -7px; border-radius: 3px; background: var(--accent); opacity: .55; }
.portrait.f-leaf { border-radius: 10px; border-color: #58b84a; }
.portrait.f-snow { border-radius: 10px; border-color: #9bd4f2; }
.portrait.f-paw { border-radius: 10px; border-color: #ee8a2b; }
.portrait.f-club { border-radius: 8px; border-width: 4px; box-shadow: 0 0 0 2px #fffdf8, 0 0 0 5px var(--accent); }
.portrait.f-gold { border-radius: 8px; border-color: #d9a521; box-shadow: 0 0 0 2px #f6d84a; }
.portrait-club { position: absolute; right: -6px; bottom: -6px; border-radius: 6px; background: #fffdf8; }

/* ---- the editor ---- */
.card-preview { margin: 6px 0 14px; }
.edit-sec { margin: 0 0 10px; }
.edit-sec h3 { margin: 12px 0 4px; font-size: 13px; }
.edit-sec textarea, .edit-sec input, .edit-sec select, .edit-row input, .edit-row select { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: .5em .8em; background: #fff; }
.edit-row { display: grid; gap: 4px; font-weight: 700; font-size: 13px; margin: 6px 0; }
.edit-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--panel) 30%); padding-top: 14px; }
.banner-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.banner-opt { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 4px; display: grid; gap: 2px; font-size: 12px; font-weight: 700; cursor: pointer; }
.banner-opt[aria-pressed="true"] { border-color: var(--green-deep); background: #e5f7ec; }
.banner-opt:disabled { opacity: .5; cursor: not-allowed; }
.banner-swatch { width: 100%; height: 34px; border-radius: 8px; }
.accent-pick, .emblem-pal { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.sticker-pick { display: flex; gap: 6px; flex-wrap: wrap; max-height: 150px; overflow: auto; }
.sticker-opt { border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 2px; cursor: pointer; line-height: 0; }
.sticker-opt[aria-pressed="true"] { border-color: var(--green-deep); background: #e5f7ec; }

/* ---- ribbons ---- */
canvas.ribbon-pic.locked { opacity: .9; }
.ribbon-pop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(22, 21, 28, .35); cursor: pointer; animation: ribbon-in .28s ease-out; }
.ribbon-pop-in { display: grid; gap: 6px; justify-items: center; text-align: center; background: var(--panel); border: 3px solid var(--gold); border-radius: 20px; padding: 18px 26px; max-width: min(92vw, 380px); box-shadow: var(--shadow); }
.ribbon-pop-in small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ribbon-pop-in b { font-size: 19px; }
.ribbon-pop-in span { color: var(--ink-soft); }
@keyframes ribbon-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ribbon-pop { animation: none; } }

.book-head h2 { margin-bottom: 0; }
.rank-bar { height: 10px; border-radius: 999px; background: #efe7d4; overflow: hidden; margin: 6px 0; }
.rank-bar i { display: block; height: 100%; background: var(--gold); }
.pin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pin-slot { min-width: 144px; min-height: 48px; border: 2px dashed var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: #fff; padding: 0; }
.pin-slot.full { border-style: solid; border-color: var(--gold); cursor: pointer; line-height: 0; }
.pin-slot.off { opacity: .5; }
.book-filter { margin: 10px 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.book-filter .chip { white-space: nowrap; }
.book-cat h3 small { color: var(--muted); font-weight: 600; }
.ribbon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ribbon-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; }
.ribbon-card.lock { background: #f6f3ea; }
.ribbon-card .btn, .ribbon-card .slot-pick { grid-column: 1 / -1; justify-self: start; }
.ribbon-text { display: grid; gap: 1px; min-width: 0; }
.ribbon-text .how { font-size: 13px; color: var(--ink-soft); }
.ribbon-text .hint { font-size: 12px; }
.prog { position: relative; display: block; height: 14px; background: #efe7d4; border-radius: 999px; overflow: hidden; margin-top: 3px; }
.prog i { display: block; height: 100%; background: var(--green-deep); opacity: .75; }
.prog em { position: absolute; inset: 0; font-size: 11px; font-style: normal; font-weight: 800; text-align: center; line-height: 14px; }
.slot-pick { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- clubs ---- */
.emblem-pic { display: block; }
.club-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.club-names { min-width: 0; display: grid; gap: 2px; }
.club-names h3 { margin: 0 !important; font-size: 21px !important; color: var(--ink); }
.club-wait { background: #fff8e6; border: 2px solid var(--gold); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-weight: 700; }
.club-row .club-pic { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; }
.club-row { grid-template-columns: auto 1fr auto; }
.club-page h3 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.club-settings { margin-top: 12px; }
.emblem-editor { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.emblem-left { display: grid; gap: 8px; justify-items: start; }
.emblem-grid { width: 224px; height: 224px; border: 2px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; background: #fff; }
.emblem-preview { display: flex; gap: 10px; align-items: end; }
.emblem-right { display: grid; gap: 8px; min-width: 0; }
@media (max-width: 560px) { .emblem-editor { grid-template-columns: 1fr; } .emblem-grid { width: 100%; height: auto; aspect-ratio: 1; max-width: 320px; } }
.club-page .club-names h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 21px !important; margin: 0 !important; }
.club-head { margin-bottom: 14px; } .club-head .emblem-pic { flex: none; }
.card-title, .card-group { justify-self: start; }
/* the name sits on paper, not on the banner, so it reads on every banner */
.card-names { background: #fffdf8; border: 2px solid var(--accent); border-radius: 12px; padding: 6px 12px 8px; margin-bottom: 8px; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.card-name { text-shadow: none !important; color: var(--ink); }
.card-head { align-items: flex-end; }

/* ---- the card, 2026-10-27: in the Menu's style (web/js/profile.js view) ---- */
.cv { border-width: 0; box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(22, 21, 28, .12); background: #fffdf8; }
.cv-svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* the banner and the portrait standing on it */
.cv-hero { position: relative; height: 132px; margin-bottom: 8px; }
.cv-hero .card-banner { position: absolute; inset: 0; width: 100%; height: 100%; }
.cv-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 45%, rgba(255, 253, 248, .0) 70%, rgba(255, 253, 248, .85)); pointer-events: none; }
.cv-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); opacity: .85; }
.cv-portrait { position: absolute; left: 18px; bottom: -48px; z-index: 1; filter: drop-shadow(0 4px 8px rgba(22, 21, 28, .22)); }
.cv-portrait .portrait { border-width: 4px; }
.cv-lv { position: absolute; right: -8px; bottom: -4px; display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 4px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); color: #fff; border: 3px solid #fffdf8;
  font: 900 15px/1 system-ui, sans-serif; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.cv-lv small { display: block; font-size: 8px; letter-spacing: .08em; opacity: .9; margin-bottom: 1px; }
.cv-dot { position: absolute; left: 2px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: #b8b2a4; border: 3px solid #fffdf8; }
.cv-dot.on { background: #1ed67c; box-shadow: 0 0 0 3px rgba(30, 214, 124, .25); }
.layout-wide .cv-hero { height: 156px; }
.layout-wide .cv-portrait { bottom: -56px; }
.layout-showcase .cv-hero { height: 96px; }

/* a VIP member's card: a gold edge, and now and then a shine across the banner */
.cv.is-vip { box-shadow: 0 0 0 2px #c9a23a, 0 0 0 4px #f2d36b, 0 8px 22px rgba(201, 162, 58, .3); }
.cv-shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cv-shine::before { content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -40%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 200, .55), transparent); transform: skewX(-18deg); animation: cv-shine 6.5s ease-in-out infinite; }
@keyframes cv-shine { 0%, 62% { left: -40%; } 100% { left: 120%; } }
@media (prefers-reduced-motion: reduce) { .cv-shine::before { animation: none; display: none; } }
.cv-crown { width: 22px; height: 22px; color: #c9a23a; fill: #f2d36b; stroke-width: 1.6; margin-right: 2px; }

/* who they are */
/* beside the portrait (it stands 48px down from the banner), and under it when the card is narrow */
.cv-id { display: grid; gap: 6px; padding: 0 18px 4px 150px; min-height: 52px; align-content: start; }
.layout-wide .cv-id { padding-left: 166px; }
@media (max-width: 420px) { .cv-hero { margin-bottom: 56px; } .cv-id, .layout-wide .cv-id { padding-left: 18px; } }
.cv-name { margin: 0 !important; display: flex; align-items: center; gap: 4px; font-size: 24px; font-weight: 900; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-tag { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 10px; color: #fff; background: var(--accent); }
.cv-tag.soft { color: var(--ink-soft); background: #f1ebdc; }
.cv-tag.rep { color: #1f5fa8; background: #e3eefb; }
.cv-tag.vip { color: #2a1418; background: linear-gradient(90deg, #c9a23a, #f2d36b); }
.cv-role { margin: 0; font-weight: 700; color: var(--ink-soft); }
.cv-status { position: relative; justify-self: start; display: flex; gap: 7px; align-items: center; margin: 4px 0 0; max-width: 100%;
  padding: 7px 12px; border-radius: 14px 14px 14px 4px; background: color-mix(in srgb, var(--accent) 12%, #fff); border: 2px solid color-mix(in srgb, var(--accent) 35%, #fff);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.cv-status .cv-svg { width: 16px; height: 16px; color: var(--accent); }
.cv-status span { overflow-wrap: anywhere; }
.cv-progress { margin-top: 2px; }
.cv-progress .exp-bar { display: grid; gap: 3px; width: 100%; max-width: none; }
.cv-progress .exp-track { display: block; width: 100%; height: 8px; border-radius: 99px; background: #efe7d4; overflow: hidden; }
.cv-progress .exp-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f2d36b, #e3b341); }
.cv-progress small { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* the tiles: like the Menu's */
.cv-tiles { display: grid; gap: 8px; padding: 12px 14px 4px; grid-template-columns: repeat(2, 1fr); }
.cv-tiles.n3 { grid-template-columns: repeat(3, 1fr); }
.cv-tiles.n4 { grid-template-columns: repeat(2, 1fr); }
.cv-tile { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 14px; background: #fff; border: 2px solid #eee4cf; text-align: left; min-width: 0; color: var(--ink); }
button.cv-tile { cursor: pointer; font: inherit; }
button.cv-tile:hover { border-color: var(--accent); }
.cv-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, #fff); flex: none; }
.cv-tv { display: grid; min-width: 0; line-height: 1.15; }
.cv-tv b { font-size: 16px; font-weight: 900; overflow-wrap: anywhere; }
.cv-tv small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.character .cv-tv b { font-size: 13.5px; font-weight: 800; }

/* what they wrote, ribbons, the Club */
.cv-body { display: grid; gap: 4px; padding: 6px 14px 10px; }
.cv-sec h3 { margin: 12px 2px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #8a8478; }
.cv-quote { position: relative; margin: 0; padding: 12px 14px 12px 40px; border-radius: 14px; background: #fff; border: 2px solid #eee4cf; overflow-wrap: anywhere; color: var(--ink); line-height: 1.45; }
.cv-quote::before { content: "\201C"; position: absolute; left: 10px; top: -2px; font: 900 44px/1 Georgia, serif; color: var(--accent); opacity: .75; }
.cv-felt { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 14px;
  background: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px) 0 0 / 6px 6px, linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, #1d1b22), color-mix(in srgb, var(--accent) 30%, #16151c));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35); }
.cv-felt .ribbon-tap canvas { box-shadow: 0 3px 5px rgba(0, 0, 0, .35); border-radius: 3px; }
.cv-felt.big { gap: 12px; }
.cv-link { justify-self: start; display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; border: 0; background: none; padding: 2px; color: var(--green-dark); font-weight: 800; font-size: 13px; cursor: pointer; }
.cv-link .cv-svg { width: 16px; height: 16px; }
.cv-club { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 14px; background: #fff; border: 2px solid #eee4cf; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.cv-club:hover { border-color: var(--accent); }
.cv-club span { display: grid; min-width: 0; }
.cv-club i { font-style: normal; font-size: 12px; color: var(--muted); }
.cv-go { color: var(--muted); }
.cv-pets { display: flex; gap: 10px; flex-wrap: wrap; }
.cv-pet { display: grid; justify-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; background: #fff; border: 2px solid #eee4cf; font-size: 12px; font-weight: 800; }
.cv-finds { display: flex; gap: 8px; flex-wrap: wrap; }

/* what you can do */
.cv-actions { display: grid; gap: 8px; padding: 12px 14px 14px; border-top: 2px solid #eee4cf; background: #faf5e6; }
.cv-act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cv-act { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 10px 7px 7px; border-radius: 14px; background: #fff; border: 2px solid #eee4cf; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.cv-act span:last-child { display: grid; line-height: 1.15; min-width: 0; }
.cv-act b { font-size: 13.5px; font-weight: 800; }
.cv-act small { font-size: 11px; color: var(--muted); }
.cv-act .cv-ic { width: 32px; height: 32px; }
.cv-act:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.cv-act:disabled { cursor: default; opacity: .75; }
.cv-act.go { background: linear-gradient(135deg, #17b566, #0f8a4c); border-color: transparent; color: #fff; }
.cv-act.go .cv-ic { background: rgba(255, 255, 255, .22); color: #fff; }
.cv-quiet { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cv-small { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 2px; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cv-small .cv-svg { width: 15px; height: 15px; }
.cv-small:hover { color: var(--ink); }
.cv-small.warn:hover { color: var(--brick); }
.cv-actions.char { background: #faf5e6; }
.cv-findme { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 700; color: var(--ink-soft); }
.cv-findme .cv-svg { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .cv-act:hover:not(:disabled) { transform: none; } }
/* a narrow screen: each tile's icon above its number, so three still fit across */
@media (max-width: 420px) {
  .cv-tiles { gap: 6px; padding: 10px 10px 2px; }
  .cv-tile { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; padding: 8px 4px; }
  .cv-tv { justify-items: center; }
  .cv-tv b { font-size: 15px; white-space: nowrap; }
  .cv-ic { width: 30px; height: 30px; }
  .character .cv-tv b { white-space: normal; }
}

/* ---- the card language, for every other panel (web/js/cardkit.js; QualityOverhaul.md §3.6) ----
   A striped band of the panel's accent with its title and stat tiles; each thing a card in its own accent (blue to buy, gold for
   VanillaBucks, green once it's yours) with its picture on a calm stage of that colour, chips with pixel icons, its price with the
   coin or the VB square, and one clear button. */
.pix { display: block; flex: none; image-rendering: pixelated; }
.khead { --accent: #17b566; display: grid; gap: 8px; margin: 0 0 12px; }
.kband { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 72px; padding: 0 12px 4px; border-radius: 16px;
  border: 2px solid var(--accent); overflow: hidden;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 34%, #fffdf8) 0 20px, color-mix(in srgb, var(--accent) 22%, #fffdf8) 20px 40px); }
.kband::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); }
.kband h2 { position: relative; z-index: 1; margin: 0 !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 12px; border-radius: 10px; background: #fffdf8; border: 2px solid var(--accent);
  font-size: 19px; font-weight: 900; line-height: 1.2; color: var(--ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 45%, transparent); }
.kart { position: relative; z-index: 1; line-height: 0; flex: none; }
.kart canvas { image-rendering: pixelated; border-radius: 12px; background: #fffdf8; border: 2px solid var(--accent); width: 48px; height: 48px; }
.klead { margin: 0; font-size: 13.5px; color: var(--muted); }
.ktiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ktile { display: flex; gap: 8px; align-items: center; border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 7px 10px; min-width: 0; }
.ktile > span:last-child { display: grid; min-width: 0; }
.ktile b { font-size: 15.5px; line-height: 1.15; overflow-wrap: break-word; }
.ktile small { font-size: 11.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kticon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 16%, #fff); flex: none; }

.kwares { display: grid; gap: 8px; }
.kware { --accent: #2f5fd0; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px 8px 8px;
  border: 2px solid color-mix(in srgb, var(--accent) 60%, #fff); border-radius: 16px; background: var(--panel); }
.kware.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.kstage { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 15%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 45%, #fff); }
.kstage canvas { image-rendering: pixelated; background: none !important; border-radius: 0 !important; max-width: 56px; max-height: 56px; }
.kwhat { min-width: 0; display: grid; gap: 3px; }
.kname { font-size: 15.5px; font-weight: 800; line-height: 1.2; }
.kwhat > small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.kchips { display: flex; flex-wrap: wrap; gap: 4px; }
.kchip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; line-height: 1; padding: 3px 8px 3px 5px; border-radius: 999px;
  color: var(--ink-soft); background: color-mix(in srgb, var(--accent) 11%, #fff); border: 1.5px solid color-mix(in srgb, var(--accent) 28%, #fff); }
.kchip.warn { color: #8a3a1a; background: #fdeee6; border-color: #f2c4ad; }
.kchip.soft { color: var(--muted); background: #f6f1e4; border-color: var(--line); }
.kwhat .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.kwhat .chips .btn { min-height: 28px; padding: .2em .75em; font-size: 12px; text-transform: capitalize; box-shadow: none; }
.kwhat .chips .btn.on { background: var(--accent); color: #fff; }
.kfoot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.kfoot:empty { display: none; }
.kfoot .row { display: flex; gap: 6px; }
.kprice { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; font-size: 15px; color: var(--ink); white-space: nowrap; }
.kprice.kvb { color: var(--green-dark); }
.kprice .vb { margin-left: 0; }
.kpill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; font-weight: 800; color: color-mix(in srgb, var(--accent) 70%, var(--ink));
  background: color-mix(in srgb, var(--accent) 12%, #fff); border: 2px solid var(--accent); border-radius: 999px; padding: 3px 11px 3px 8px; }
.kgroup { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
@media (max-width: 460px) {
  .kware { grid-template-columns: 56px 1fr; }
  .kstage { width: 56px; height: 56px; }
  .kfoot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--line); padding-top: 8px; }
  .kfoot:has(> :only-child) { justify-content: flex-end; }
}
/* a panel that opens on a band (no tabs above it): its close button sits inside the band, centred, as a paper button, and the
   band keeps its own things clear of it */
.sheet:not(:has(> .sheet-tabs)):has(> .sheet-body > .khead:first-child, > .sheet-body > :first-child > .khead:first-child) > .close {
  top: 34px; right: 28px; min-width: 36px; width: 36px; height: 36px; padding: 0; background: #fffdf8; border: 2px solid rgba(22, 21, 28, .18);
  box-shadow: 0 2px 0 rgba(22, 21, 28, .12); }
.sheet:not(:has(> .sheet-tabs)) > .sheet-body > .khead:first-child .kband,
.sheet:not(:has(> .sheet-tabs)) > .sheet-body > :first-child > .khead:first-child .kband { padding-right: 60px; }
/* the Bag's slots on the card language's stage: each a framed stage of the Bag's green, its count in a chip */
.khead .kart .bag-pic { width: 48px; height: 48px; }
.bag-slot { border-color: color-mix(in srgb, #17b566 40%, #fff); background: color-mix(in srgb, #17b566 9%, #fbf6ea); border-radius: 14px; }
.bag-slot b { top: 5px; right: 5px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: #fffdf8; border: 1.5px solid color-mix(in srgb, #17b566 45%, #fff); font-size: 11.5px; text-align: center; }
.bag-slot span { color: var(--ink-soft); font-weight: 700; }
.bag-slot.empty { background: #f7f2e6; border-color: var(--line); }
/* a day's task: what's left of it on the stage, its reward in chips */
.ktask { grid-template-columns: 48px 1fr auto; padding: 6px 10px 6px 6px; }
.ktask .kstage { width: 48px; height: 48px; }
.ktask-n { font-weight: 900; font-size: 15px; color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.ktask .kname { font-size: 14.5px; }
.ktask.done .kname { color: var(--muted); }
.daily .kgroup { margin-top: 16px; }
.daily .klead { margin-bottom: 8px; }
/* the post: each letter in its box's accent (web/js/mail.js row), its picture on a stage of that colour; new ones lit */
.khead .kart .btn { background: #fffdf8; border: 2px solid var(--accent); box-shadow: none; }
.letter { --accent: #2f5fd0; grid-template-columns: 84px 1fr auto; border-color: color-mix(in srgb, var(--accent) 45%, #fff); border-radius: 16px; background: var(--panel); padding: 8px 10px 8px 8px; }
.letter.unread { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.letter-stage { display: grid; place-items: center; width: 84px; height: 60px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 40%, #fff); }
.letter-text .kind { border: 0; background: none; padding: 0; border-radius: 0; display: block; cursor: inherit; color: color-mix(in srgb, var(--accent) 75%, var(--ink)); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 800; }
.letter.unread .letter-text b::after { background: var(--accent); }
@media (max-width: 420px) { .letter { grid-template-columns: 72px 1fr; } .letter-stage { width: 72px; } }
/* the clothes (web/js/shop.js): each piece a card in its accent (green yours, gold VanillaBucks, blue to buy), the piece on a
   calm stage of that colour, its price with the coin or the VB square; the one being tried on lit */
.item.k-own { --accent: #17b566; } .item.k-vb { --accent: #d9a521; } .item.k-buy { --accent: #2f5fd0; }
.item.k-own, .item.k-vb, .item.k-buy { border-color: color-mix(in srgb, var(--accent) 45%, #fff); background: var(--panel); border-radius: 16px; padding: 6px 6px 8px; gap: 4px; }
.item.k-own canvas, .item.k-vb canvas, .item.k-buy canvas { width: 100%; height: 92px; object-fit: contain; border-radius: 12px; box-sizing: border-box; padding: 2px 0;
  background: color-mix(in srgb, var(--accent) 13%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 35%, #fff); }
.item.k-own[aria-pressed="true"], .item.k-vb[aria-pressed="true"], .item.k-buy[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.item.k-own .price, .item.k-vb .price, .item.k-buy .price { font-size: 13px; font-weight: 900; color: var(--ink); }
.item.k-own .price.owned { color: var(--green-dark); }
.item.k-vb .price { color: var(--green-dark); }
.item.k-vb .price.locked { color: var(--muted); }
.item.k-own .price .vb, .item.k-vb .price .vb, .item.k-buy .price .vb { margin-left: 0; }
/* Ken's showroom (web/js/home.js openShowroom): each piece a card in its accent (gold for VanillaBucks, blue for coins), the
   piece on a calm stage of that colour, its price with the coin or the VB square */
.piece.k-vb, .piece-big.k-vb { --accent: #d9a521; } .piece.k-buy, .piece-big.k-buy { --accent: #2f5fd0; }
.piece.k-vb, .piece.k-buy { border-color: color-mix(in srgb, var(--accent) 45%, #fff); background: var(--panel); border-radius: 16px; gap: 4px; }
.piece.k-vb:hover, .piece.k-buy:hover { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.piece-stage { display: grid; place-items: center; width: 100%; border-radius: 12px; padding: 4px 0;
  background: color-mix(in srgb, var(--accent, #2f5fd0) 13%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent, #2f5fd0) 35%, #fff); }
.piece-stage .piece-icon { background: none !important; }
.piece .kprice { font-size: 13px; }
.piece-big .piece-stage { width: auto; padding: 6px; flex: none; }
.piece-big h2 { margin: 0 0 4px; }
.piece-big .kprice { font-size: 18px; }

.kticon .vb { margin-left: 0; }
/* the Bank (web/js/bank.js): each of coins and VanillaBucks a gold card, its sums as chips; the statement as quiet cards */
.bank-row { --accent: #d9a521; border-color: color-mix(in srgb, var(--accent) 50%, #fff); background: var(--panel); border-radius: 16px; padding: 10px 12px; }
.bank-row > b { font-size: 15.5px; }
.bank-sums span { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: var(--ink-soft);
  background: color-mix(in srgb, var(--accent) 11%, #fff); border: 1.5px solid color-mix(in srgb, var(--accent) 28%, #fff); }
.bank-statement { gap: 6px; }
.bank-line { border: 2px solid color-mix(in srgb, #d9a521 30%, #fff); border-radius: 14px; background: var(--panel); padding: 8px 12px; }
.bank-line > span:nth-child(2) { font-weight: 900; }
.bank-line .amt.up { color: var(--green-dark); } .bank-line .amt.down { color: var(--brick); }
/* Friends (web/js/friends.js): each friend a card, green when they're on, gold when they're asking, quiet when they're away;
   their face on a stage of that colour */
.friend-lists h3 { margin: 14px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.friend-row { --accent: #8a8170; border-color: color-mix(in srgb, var(--accent) 40%, #fff); background: var(--panel); border-radius: 16px; padding: 8px 10px 8px 8px; }
.friend-row.online { --accent: #17b566; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.friend-row.asking { --accent: #d9a521; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.friend-face { width: 52px; height: 52px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 15%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 45%, #fff); }
.friend-status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 3px; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  color: var(--ink-soft); background: color-mix(in srgb, var(--accent) 11%, #fff); border: 1.5px solid color-mix(in srgb, var(--accent) 28%, #fff); }
.friend-add input:focus { border-color: #d9567f; }
/* Benny's prize counter (web/js/arcade.js prizes): purple to take, green once it's yours, quiet while the tickets are short */
.prize { --accent: #8a3fc4; border-color: color-mix(in srgb, var(--accent) 45%, #fff); background: var(--panel); border-radius: 16px; padding: 6px 6px 10px; }
.prize.k-own { --accent: #17b566; } .prize.short { --accent: #8a8170; opacity: .8; }
.prize-stage { display: grid; place-items: center; width: 100%; padding: 6px 0; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 13%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 35%, #fff); }
.prize-cost { display: inline-flex; align-items: center; gap: 5px; color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
/* the citizens' shops (web/js/business.js): stock and team rows as cards in the shop's blue, the good's picture on a stage, the
   price with its coin; the owner's rows (open, tidy) the same */
.stock-row, .shop-row { --accent: #2f5fd0; border-color: color-mix(in srgb, var(--accent) 40%, #fff); background: var(--panel); border-radius: 16px; }
.stock-row { padding: 8px 10px 8px 8px; }
.stock-row > canvas:first-child, .stock-row > .item-icon:first-child, .stock-row > .piece-icon:first-child { box-sizing: content-box; padding: 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 13%, #fbf6ea); border: 2px solid color-mix(in srgb, var(--accent) 35%, #fff); image-rendering: pixelated; }
.stock-row > div > b { font-size: 15px; }
.stock-row .price { font-size: 15px; font-weight: 900; color: var(--ink); }
.stock-row.plain { --accent: #8a8170; }
.shop-row { --accent: #17b566; }

/* ---- Mail, reading one (web/js/mail.js showLetter; QualityOverhaul.md §2.11) --------------------------------------
   The band in the box's colour with the sender's face, then the thing itself on a stage of that colour: a postcard,
   a letter on ruled paper with a wax seal, a gift on a pedestal with its tag on a string, flowers with the florist's
   card. What a gift held comes out as a card; the buttons sit in one foot. */
.mail-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 10px; }
.mail-nav .back { margin: 0; }
.mail-read { --accent: #2f5fd0; display: grid; gap: 12px; }
.mail-read .reading { gap: 12px; }
.mail-stage { position: relative; justify-self: stretch; display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 22px 16px 18px; border-radius: 18px; overflow: hidden; isolation: isolate;
  border: 2px solid color-mix(in srgb, var(--accent) 40%, #fff);
  background: color-mix(in srgb, var(--accent) 12%, #fbf6ea); }
/* a floor for the thing to stand on: one flat band, the same colour a step darker */
.mail-stage::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 30%;
  background: color-mix(in srgb, var(--accent) 22%, #f2ead8); border-top: 2px solid color-mix(in srgb, var(--accent) 30%, #fff); }
.mail-stage.wide { padding: 16px; }
.mail-stage.wide::after { display: none; }
.gift-pedestal { position: relative; display: grid; place-items: end center; }
.gift-pedestal::after { content: ""; position: absolute; z-index: -1; bottom: 2px; left: 50%; width: 72%; height: 14px; transform: translateX(-50%);
  border-radius: 50%; background: rgba(22, 21, 28, .16); }
.mail-stage .gift-big { display: block; filter: drop-shadow(0 3px 0 rgba(22, 21, 28, .12)); }
/* the tag hangs on a string from the bow */
.mail-stage .gift-tag { border-color: color-mix(in srgb, var(--accent) 45%, #e2d8c2); box-shadow: 0 3px 0 rgba(22, 21, 28, .08); transform: rotate(-2deg); }
.mail-stage .gift-tag::after { content: ""; position: absolute; left: -26px; top: 50%; width: 30px; height: 2px; background: color-mix(in srgb, var(--accent) 55%, #c9bfa6);
  transform: rotate(-14deg); transform-origin: right center; }
.mail-stage .gift-tag b { font-size: 16px; }
.flowers-stage .flowers-big { display: block; }
.flowers-stage .florist-card { transform: rotate(2deg); }
.flowers-stage .florist-card small { font-family: system-ui, sans-serif; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
/* confetti as the paper comes off: flat squares that fly out and fall, gone in a second */
.confetti { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.confetti i { position: absolute; width: 6px; height: 6px; border-radius: 1px; opacity: 0; animation: confetti 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
.confetti i:nth-child(3n) { width: 4px; height: 8px; }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 70px)) rotate(260deg); }
}
/* what the gift held */
.inside { justify-self: stretch; display: grid; gap: 8px; }
.inside > .kware { animation: inside-in .35s ease both; }
@keyframes inside-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.inside-card .kstage { width: 72px; height: 88px; }
.inside-card .kstage canvas.inside-pic { max-width: 64px; max-height: 84px; width: auto; height: 84px; background: none; }
.inside-card .big-coin { width: 34px; height: 34px; }
.inside-card { grid-template-columns: 72px 1fr auto; }
.mail-after { display: flex; justify-content: center; }
/* a letter: ruled writing paper with a red margin, the crest or a greeting at its head, signed, sealed in wax */
.paper-letter.ruled { position: relative; padding: 18px 22px 26px 40px;
  background: linear-gradient(90deg, transparent 0 28px, #e9a8a0 28px 29.5px, transparent 29.5px);
  background-color: #fbf7ec; border: 2px solid #e8dfca; box-shadow: 0 4px 0 rgba(22, 21, 28, .06), 0 10px 22px rgba(22, 21, 28, .12); }
.paper-letter.ruled .letterhead { border-bottom: 0; margin-bottom: 4px; padding-bottom: 4px; }
.paper-letter.ruled .letterhead b { font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive; color: #2a3a6a; font-size: 16px; }
.letter-crest { width: 40px; height: 40px; image-rendering: pixelated; }
.paper-letter .letter-body, .paper-letter .letter-sign { background: repeating-linear-gradient(transparent 0 25px, #dfe6ee 25px 26px); background-origin: content-box; }
.paper-letter .letter-sign { line-height: 26px; margin: 0; }
.paper-letter .letter-body { margin: 0; line-height: 26px; color: #2a3a6a; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px;
  font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive; }
.paper-letter .letter-sign { text-align: right; font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive; color: #2a3a6a; }
.paper-letter .wax { position: absolute; right: 14px; top: -10px; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--accent) 60%, #fff) 0 18%, var(--accent) 19% 62%, color-mix(in srgb, var(--accent) 70%, #000) 63%);
  box-shadow: 0 2px 0 rgba(22, 21, 28, .2); }
/* the buttons: one foot, the main one first */
.mail-actions { justify-content: center; padding-top: 10px; border-top: 2px dashed color-mix(in srgb, var(--accent) 30%, var(--line)); }
@media (max-width: 460px) {
  .mail-stage { padding: 16px 10px 14px; gap: 12px; }
  .mail-stage .gift-tag { max-width: 100%; transform: none; }
  .mail-stage .gift-tag::after { display: none; }
  .paper-letter.ruled { padding: 16px 14px 22px 34px; background-position: -6px 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .inside > .kware { animation: none; } .mail-stage .gift-tag, .flowers-stage .florist-card { transform: none; } }
.mail-read, .mail-read .reading { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.mail-after .kpill { white-space: normal; text-align: left; line-height: 1.3; }

/* cards: level, reputation, VIP */
.card-standing { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.badge-level, .badge-rep, .badge-vip { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
.badge-level { background: #23221f; color: #f2d36b; }
.badge-rep { background: #e8f1fb; color: #2a62c9; }
.badge-vip { background: linear-gradient(90deg, #c9a23a, #f2d36b); color: #2a1418; letter-spacing: .06em; }
.card-names .exp-bar { margin-top: 4px; max-width: 180px; }
.portrait.f-vip { box-shadow: 0 0 0 3px #c9a23a, 0 0 0 5px #2a1418; }

/* The town pages (Citizens, Clubs, the store): looked-up citizens and Clubs, drawn by the game's own code. build.py puts the game's
   card styles (web/css/cards.css) in front of this as /css/town.css, so a card looks as it does in town. */

.band-tight { padding: 40px 0; }
.band-town { padding: 36px 0 64px; min-height: 40vh; }
.hint { color: var(--muted); font-size: 15px; }
.hint.error { color: var(--brick); font-weight: 700; }
.crumbs { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
canvas.px, .px { image-rendering: pixelated; }

/* looking someone up */
.finder { display: grid; gap: 8px; max-width: 640px; margin-bottom: 26px; }
.finder-label { font-weight: 800; font-size: 18px; }
.finder-row { display: flex; gap: 10px; flex-wrap: wrap; }
.finder-row input { flex: 1 1 220px; min-width: 0; font: inherit; padding: .55em .9em; border: var(--edge); border-radius: 12px; background: #fff; min-height: 52px; }
.finder-row input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 14px; }
.list-more { display: flex; justify-content: center; margin: 18px 0 0; }
.who { display: grid; justify-items: center; gap: 6px; padding: 14px 10px 12px; border: var(--edge); border-radius: var(--radius); background: var(--panel); box-shadow: 0 4px 0 var(--ink);
  color: var(--ink); text-decoration: none; text-align: center; transition: transform .12s; min-width: 0; }
.who:hover, .who:focus-visible { transform: translateY(-2px); }
.who-face { width: 64px; height: 64px; border-radius: 50%; background: #e5f7ec; border: 2px solid var(--line); }
.who-name { font-weight: 800; overflow-wrap: anywhere; }
.who-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

/* a citizen's page */
.town-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.town-side, .town-main { display: grid; gap: 24px; min-width: 0; }
@media (max-width: 900px) { .town-grid { grid-template-columns: minmax(0, 1fr); } }
.town-box { border: var(--edge); border-radius: var(--radius); background: var(--panel); box-shadow: var(--drop); padding: 18px 20px; min-width: 0; }
.town-box h2 { margin: 0 0 8px; font-size: 22px; }
.town-box h3 { margin: 14px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.town-card { border: var(--edge); box-shadow: var(--drop); }
.town-card .card-name { font-size: 26px; }
.card-club { color: var(--ink); text-decoration: none; }
.card-club:hover b { text-decoration: underline; }
.body-row { display: flex; gap: 6px; justify-content: center; align-items: flex-end; background: linear-gradient(#e3f1f9, #f4efe2); border-radius: 12px; padding: 10px; }
.body-pic { width: 104px; height: 176px; }
@media (max-width: 420px) { .body-pic { width: 78px; height: 132px; } }
.pet-list { margin: 0; padding-left: 1.2em; }
.room-frame { border-radius: 12px; overflow: hidden; background: #16151c; display: grid; place-items: center; min-height: 200px; }
.room-frame .hint { color: #d8d3c4; }
.room-pic { display: block; width: 100%; height: auto; }

/* ribbons */
.rib { margin: 0; position: relative; line-height: 0; }
.rib canvas { display: block; }
.rib figcaption { position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 240px;
  display: none; gap: 2px; line-height: 1.35; font-size: 13px; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 10px; text-align: center; }
.rib figcaption span { color: #d8d3c4; }
.rib figcaption i { color: var(--gold); font-style: normal; font-size: 12px; }
.rib:hover figcaption, .rib:focus figcaption, .rib:focus-within figcaption { display: grid; }
.rib:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 3px; border-radius: 4px; }
.rib-cat { margin: 12px 0 6px; font-size: 14px; color: var(--ink-soft); }

/* Clubs */
.club-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.club-tile { display: flex; gap: 14px; align-items: center; padding: 14px; border: var(--edge); border-radius: var(--radius); background: var(--panel); box-shadow: 0 4px 0 var(--ink); color: var(--ink); text-decoration: none; min-width: 0; }
.club-tile:hover, .club-tile:focus-visible { transform: translateY(-2px); }
.club-tile canvas { flex: none; image-rendering: pixelated; }
.club-tile-text { display: grid; gap: 2px; min-width: 0; }
.club-tile-text b { font-size: 18px; overflow-wrap: anywhere; }
.club-tile-text i { color: var(--ink-soft); overflow-wrap: anywhere; }
.club-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.club-head canvas { image-rendering: pixelated; flex: none; }
.club-head h1 { margin: 0; overflow-wrap: anywhere; }
.club-motto { margin: 4px 0; font-style: italic; }
.club-role { border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 800; background: #e5f7ec; color: var(--green-dark); }
.club-role.r-president { background: #23221f; color: #f2d36b; }
.club-role.r-vp { background: #e8f1fb; color: #2a62c9; }

/* the store */
.store-jump { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.store-jump a { font-weight: 800; }
.store-vip, .store-vb { margin-bottom: 26px; }
.perks { margin: 6px 0 14px; padding-left: 1.2em; }
.tiers, .packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; margin: 10px 0; }
.tier, .pack { display: grid; gap: 4px; align-content: start; justify-items: start; padding: 16px; border: 3px solid var(--ink); border-radius: var(--radius); background: #fff; }
.tier { background: #2a1418; color: #f4efe2; border-color: #c9a23a; }
.tier.tier-life { background: linear-gradient(135deg, #2a1418, #5a1f2e); }
.tier h3, .town-box .tier h3 { margin: 0; font-size: 20px; color: #f2d36b; text-transform: none; letter-spacing: 0; }   /* the card's gold, over the box's own heading ink (they were near-black on maroon) */
.tier p { margin: 0; }
.tier .hint { color: #d8c9a6; }
.tier-len { font-weight: 700; }
.tier-vb { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.3; }
/* the VB square beside a tier's price: its own size, never squeezed by the words next to it (it went tall and thin), no gap under it */
.tier-vb .vb-mark { flex: none; width: 28px; height: 28px; margin: 0; font-size: 16px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--green-dark); }
.tier .btn, .pack .btn { margin-top: 8px; }
.tier-was { margin-top: 6px !important; font-weight: 800; color: #f2d36b; }
.tier-was s { color: #d8c9a6; font-weight: 600; margin-right: 2px; }
.pack h3 { margin: 4px 0 0; font-size: 28px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.pack-name { margin: 0; font-weight: 700; }
.pack-note { margin: 0; font-size: 13px; font-weight: 800; color: var(--green-dark); background: #e5f7ec; border-radius: 999px; padding: 0 8px; }
.vb-mark.big { width: 34px; height: 34px; font-size: 20px; }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.buy-box { border: var(--edge); border-radius: var(--radius); background: #fff8e1; box-shadow: var(--drop); padding: 20px 22px; scroll-margin-top: 130px; }
.buy-form, .order-done { display: grid; gap: 10px; }
.buy-form h2, .order-done h2 { margin: 0; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.code-row { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; vertical-align: middle; }
.code-box { font: 800 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; padding: .4em .6em; border: var(--edge); border-radius: 10px; background: #fff; width: 13.5ch; box-sizing: content-box; }

/* a citizen's page, laid out like a game's player page */
.pro { --accent: #17b566; }
.pro-hero { position: relative; border: var(--edge); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--panel); }
.pro-banner { display: block; width: 100%; height: 170px; image-rendering: pixelated; }
.pro-hero-in { display: flex; gap: 18px; align-items: flex-end; padding: 0 22px 16px; margin-top: -70px; position: relative; flex-wrap: wrap; }
.pro-hero-in .portrait { box-shadow: 0 4px 0 var(--ink); }
.pro-names { display: grid; gap: 4px; min-width: 0; padding-bottom: 4px; }
.pro-name { margin: 0; font-size: clamp(28px, 5vw, 44px); line-height: 1.05; overflow-wrap: anywhere; text-shadow: 0 2px 0 #fffdf8, 0 0 8px #fffdf8; }
.pro-sub { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-weight: 700; }
.pro-bar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; border: var(--edge); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 18px; box-shadow: 0 4px 0 var(--accent); }
.pro-bar-in { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px 22px; max-width: none; }
.pro-bar-name { font-size: 20px; color: #fff; }
.pro-bar-club { display: inline-flex; gap: 6px; align-items: center; color: #fff; font-weight: 700; text-decoration: none; }
.pro-bar-club:hover span { text-decoration: underline; }
.pro-bar-club canvas { image-rendering: pixelated; background: #fffdf8; border-radius: 4px; }
.pro-bar-level { display: inline-flex; gap: 10px; align-items: center; margin-left: auto; }
.pro-exp { display: inline-grid; gap: 2px; min-width: 150px; }
.pro-exp small { font-size: 12px; color: #d8d3c4; }
.pro-exp-bar { display: block; height: 8px; border-radius: 99px; background: #3a3942; overflow: hidden; }
.pro-exp-bar i, .pro-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f6d84a); border-radius: 99px; }
.pro-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.pro-badges { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pro-badge { border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 14px; background: #fff; }
.pro-badge.b-vip { background: linear-gradient(90deg, #c9a23a, #f2d36b); }
.pro-badge.b-years { background: #e8f1fb; }
.pro-badge.b-rep { background: #e5f7ec; }
.pro-badge.b-club { background: #fbe3ea; }
.pro-badge.b-rank { background: #23221f; color: #f2d36b; }
.pro-copy { min-height: 40px; padding: .3em 1em; font-size: 15px; }
.pro-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .pro-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pro-tile { display: grid; gap: 2px; align-content: start; padding: 16px 18px; border: var(--edge); border-radius: var(--radius); background: var(--panel); box-shadow: 0 4px 0 var(--ink); min-width: 0; }
.pro-tile b { font-size: clamp(26px, 4vw, 40px); line-height: 1.05; overflow-wrap: anywhere; }
.pro-tile span { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; color: var(--ink-soft); }
.pro-tile small { color: var(--muted); font-size: 13px; }
.pro-doings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 16px; margin-bottom: 24px; }
.pro-card { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border: var(--edge); border-radius: var(--radius); background: #fff; min-width: 0; }
.pro-card h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.pro-card select { font: inherit; font-weight: 700; padding: .35em .6em; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); max-width: 100%; }
.pro-dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: 15px; }
.pro-dl dt { color: var(--ink-soft); }
.pro-dl dd { margin: 0; font-weight: 800; text-align: right; }
.pro-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pro-head h2, .pro-head h3 { margin-bottom: 8px; }
.pro-count { font-weight: 800; color: var(--ink-soft); }
.pro-meter { height: 12px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; overflow: hidden; margin-bottom: 12px; }
.rib-feature { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.rib-feature li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.rib-feature li canvas { image-rendering: pixelated; }
.rib-feature div { display: grid; gap: 1px; line-height: 1.35; min-width: 0; }
.rib-feature span { color: var(--ink-soft); font-size: 15px; }
.rib-feature i { color: var(--muted); font-style: normal; font-size: 13px; }
.rib-all summary { cursor: pointer; font-weight: 800; margin: 6px 0; }
.wearing { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 15px; }
.wearing li { display: inline-flex; gap: 6px; align-items: center; }
.wear-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: #ccc; }
.town-box h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 17px; }

/* the Ribbon Book */
.book-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.book-tools input { flex: 1 1 220px; font: inherit; padding: .5em .9em; border: var(--edge); border-radius: 12px; min-height: 48px; }
.book-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.book-cats button { font: inherit; font-weight: 800; font-size: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: .25em .8em; cursor: pointer; }
.book-cats button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.book-cat { margin-bottom: 26px; }
.book-cat h2 { display: flex; gap: 10px; align-items: baseline; }
.book-cat h2 small { color: var(--muted); font-size: 15px; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 10px; }
.book-list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: var(--edge); border-radius: 12px; background: var(--panel); }
.book-list li canvas { image-rendering: pixelated; }
.book-list div { display: grid; line-height: 1.35; min-width: 0; }
.book-list span { color: var(--ink-soft); font-size: 15px; }
.book-list i { font-style: normal; font-size: 13px; color: var(--muted); }
.pro-card > * { min-width: 0; }
.pro-card select { width: 100%; }
@media (max-width: 520px) {
  .rib-feature li, .book-list li { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .pro-hero-in { margin-top: -54px; padding: 0 14px 12px; }
  .pro-banner { height: 120px; }
  .pro-bar-in { padding: 10px 14px; gap: 10px; }
  .pro-bar-level { margin-left: 0; }
}

/* Leaderboards */
.board-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.board-tabs .chip { font: inherit; font-weight: 850; padding: .45em 1.1em; border: var(--edge); border-radius: 999px; background: var(--panel); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.board-tabs .chip[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; margin-bottom: 18px; }
.board-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.board-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.board-list li.top1 { background: #fbf0c9; } .board-list li.top2 { background: #f0f0ee; } .board-list li.top3 { background: #f7e3cf; }
.board-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 800; }
.board-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who:hover span { text-decoration: underline; }
.board-face { width: 40px; height: 40px; border-radius: 50%; background: #e5f7ec; border: 2px solid var(--line); flex: none; }
.board-n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--ink); font-weight: 900; font-size: 13px; background: #f4f1ea; }
.rank.r1 { background: #f2d36b; } .rank.r2 { background: #dcdcdc; } .rank.r3 { background: #e0a56b; }
.arcade-grid .board-list li:nth-child(n+4) { display: none; }
.club-board { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 760px; }
.club-board li { display: flex; align-items: center; gap: 12px; }
.club-board .club-tile { flex: 1; }
.floor-tabs { display: flex; gap: 8px; margin: 0 0 10px; }
.floor-tabs .chip { font: inherit; font-weight: 800; padding: .3em .9em; border: 2px solid var(--ink); border-radius: 999px; background: var(--panel); cursor: pointer; }
.floor-tabs .chip[aria-selected="true"] { background: var(--ink); color: var(--panel); }

/* the store's pay buttons: PayPal, and Cash App beside it */
.pay-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.pay-btns .btn-cash { background: #00d64f; }
