/* The stitched-toy look (owner, 3 Dec 2026): quilted navy cloth, an orange felt header, denim panels with cream
   stitching and padded buttons. A layer over shell.css, home.css and meta.css: shape and layout stay there, the fabric
   is here. Colours come from theme.css (shared/app/theme.json); the two fabric tiles (shared/ui/, made by
   tool/make_toy_textures.py) are the ones the Unity app uses. Selectors start with :root so they also win over
   meta.css, which is added to the page later. */
:root {
  --felt: url('../../shared/ui/felt.png');
  --cloth-blue: linear-gradient(180deg, #47659f, #2b4377);
  --cloth-teal: linear-gradient(180deg, #1c8a82, #12665f);
  --quilt: url('../../shared/ui/quilt.png');
  --lift: 0 3px 0 rgba(0,0,0,.34), 0 7px 16px rgba(0,0,0,.28);
  --puff: inset 0 2px 0 rgba(255,255,255,.20), inset 0 -3px 6px rgba(0,0,0,.22);
}
:root body { background: var(--c-ground) var(--quilt) repeat; background-size: 128px 128px; }
:root h1, :root h2 { text-shadow: 0 2px 0 rgba(0,0,0,.35); }

/* ---------- Header: orange felt with a stitched seam ---------- */
:root .top { background: var(--felt), linear-gradient(180deg, var(--c-headerTop), var(--c-headerBottom)); border-bottom: 0;
  border-radius: 0 0 22px 22px; box-shadow: 0 4px 0 #9c4f10, 0 10px 22px rgba(0,0,0,.35); }
:root .top::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 4px; border-bottom: 2px dashed var(--c-headerStitch); pointer-events: none; }
/* The logo: the plush Pocket Pal in its pocket and the felt lettering (shared/ui/, see brand/README.md). The word
   stays in the page for screen readers; its picture is what shows. */
:root .brand-mark, :root .top .brand-mark { width: 46px; height: 56px; object-fit: contain; border-radius: 0; box-shadow: none; filter: drop-shadow(0 3px 3px rgba(70,30,0,.4)); }
:root .brand-name { width: 156px; height: 39px; font-size: 0; background: url('../../shared/ui/logo-word.png') left center / contain no-repeat; }
:root .who .brand.big { flex-direction: column; gap: 6px; }
:root .who .brand.big .brand-mark { width: 96px; height: 116px; }
:root .who .brand.big .brand-name { width: 240px; height: 60px; background-position: center; }
:root .page-title { color: #fff; text-shadow: 0 2px 0 #7a3a06, 0 1px 3px rgba(80,35,0,.6); }
:root .top .icon-btn, :root .top .chip-btn, :root .me { background: var(--felt), linear-gradient(180deg, #4a6aa8, #2c457c); color: #fff;
  border: 0; outline: 1.5px dashed var(--c-stitch); outline-offset: -4px; box-shadow: 0 0 0 2px #f6e8cb, var(--lift); }
:root .hsearch { background: var(--felt), #fbf0d6; color: var(--c-inkDark); border: 2px solid #fff8e8; outline: 1.5px dashed #b98a4a; outline-offset: -6px;
  box-shadow: inset 0 3px 8px rgba(122,70,28,.25), var(--lift); height: 46px; border-radius: 23px; padding: 0 16px; }
:root .hsearch input { color: var(--c-inkDark); font-weight: 600; }
:root .hsearch input::placeholder { color: #6f5330; }
:root .hsearch:focus-within { border-color: #fff; box-shadow: 0 0 0 3px var(--accent), var(--lift); }
@media (max-width: 620px) {
  /* The pal stands beside both rows; search gets the second row, so "Find a game" is never cut short. */
  :root.pkt-wide .top { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 12px; }
  :root.pkt-wide .top .brand-mark { position: absolute; left: var(--gut); top: 14px; width: 76px; height: 92px; }
  :root.pkt-wide .brand { padding-left: 82px; }
  :root.pkt-wide .brand-name { display: block; width: 134px; height: 34px; }
  :root.pkt-wide .hsearch { order: 10; flex: 1 0 calc(100% - 84px); width: auto; margin-left: 84px; }
  :root.pkt-wide .top .me { max-width: none; }
  :root.pkt-wide .top .me .nm { display: none; }
}
@media (max-width: 420px) {
  :root.pkt-wide .top { gap: 6px; }
  :root.pkt-wide .top .brand-mark { width: 64px; height: 78px; top: 18px; }
  :root.pkt-wide .brand { padding-left: 68px; }
  :root.pkt-wide .brand-name { width: 106px; height: 28px; }
  :root.pkt-wide .hsearch { flex-basis: calc(100% - 72px); margin-left: 72px; }
}

/* ---------- Category chips: a little felt train ---------- */
:root .shome .kinds { gap: 14px; padding-top: 18px; padding-bottom: 14px; }
:root .shome .kind { --k1: #1c8a82; --k2: #12665f; position: relative; min-height: 46px; padding: 0 18px; border: 0; border-radius: 14px; color: #fff;
  background: var(--felt), linear-gradient(180deg, var(--k1), var(--k2)); outline: 1.5px dashed var(--c-stitch); outline-offset: -5px; box-shadow: var(--puff), var(--lift);
  text-shadow: 0 1px 2px rgba(0,0,0,.45); margin-bottom: 4px; }
:root .shome .kind[data-kind="arcade"] { --k1: #bd5a14; --k2: #94420b; }
:root .shome .kind[data-kind="puzzle"] { --k1: #477f2c; --k2: #34621f; }
:root .shome .kind[data-kind="words"] { --k1: #7d4aa6; --k2: #603585; }
:root .shome .kind[data-kind="little"] { --k1: #b3477a; --k2: #8e325d; }
:root .shome .kind[data-kind="board"] { --k1: #94602f; --k2: #714420; }
:root .shome .kind::before, :root .shome .kind::after { content: ''; position: absolute; bottom: -10px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, #7a461c 0 18%, #f6e8cb 20% 34%, #c0463c 36%); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
:root .shome .kind::before { left: 12px; } :root .shome .kind::after { right: 12px; }
:root .shome .kind[aria-pressed="true"] { box-shadow: var(--puff), 0 0 0 3px var(--c-cream), 0 0 14px 3px rgba(255,216,74,.55); }

/* ---------- Padded buttons ---------- */
:root .play, :root .btn.main { background: var(--felt), linear-gradient(180deg, var(--c-goTop), var(--c-goBottom)); color: var(--c-goText); border: 0;
  outline: 1.5px dashed var(--c-goStitch); outline-offset: -5px; box-shadow: var(--puff), 0 4px 0 var(--c-goShadow), 0 8px 18px rgba(0,0,0,.3); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
:root .play:active, :root .btn.main:active { box-shadow: var(--puff), 0 2px 0 var(--c-goShadow); }
:root .btn:not(.main), :root .more, :root .plain-btn, :root .quick-btn:not(.on) { background: var(--felt), var(--cloth-blue); color: #fff; border: 0;
  outline: 1.5px dashed var(--c-stitch); outline-offset: -5px; box-shadow: var(--puff), var(--lift); }
:root .btn.danger { background: var(--felt), linear-gradient(180deg, #a63d4c, #7e2634); color: #fff; }
:root .round { background: var(--felt), var(--cloth-blue); border: 2px solid var(--c-cream); box-shadow: var(--puff), var(--lift); }
:root .round[aria-pressed="true"] { background: var(--c-cream); color: #10172f; }
:root .round.fav[aria-pressed="true"] { background: var(--gold); color: var(--c-goText); }

/* ---------- Hero ---------- */
:root .hero { border: 5px solid var(--c-cream); box-shadow: 0 6px 0 #b79a6a, 0 14px 30px rgba(0,0,0,.4); }
/* The stitching round the picture sits above the picture and under the words. */
:root .hero .hero-text::before { content: none; }
:root .heroes .hero::before { content: ''; position: absolute; inset: 7px; z-index: 1; border: 2px dashed var(--c-stitch); border-radius: 17px; pointer-events: none; }
:root .hero .eyebrow { color: var(--c-goText); background: var(--felt), linear-gradient(180deg, var(--c-goTop), var(--c-goBottom)); padding: 5px 12px; border-radius: 10px;
  outline: 1.5px dashed var(--c-goStitch); outline-offset: -4px; box-shadow: var(--lift); text-shadow: none; }
:root .hero-h { color: #fff; text-shadow: 0 2px 0 #7a2f4a, 2px 3px 0 #7a2f4a, -1px 2px 0 #7a2f4a, 0 6px 16px rgba(0,0,0,.55); }
:root .hero p { color: #fff; }
:root .fact, :root .fact.age { background: var(--felt), rgba(22,34,74,.86); border: 1.5px dashed var(--c-stitch); color: #fff; padding: 4px 10px; border-radius: 12px; }
:root .fact.age { background: var(--felt), rgba(126,58,20,.92); }
@media (max-width: 620px) {
  :root .hero { aspect-ratio: 8 / 9; min-height: 330px; max-height: 58vh; }
  :root .hero .hero-text { left: 18px; right: 18px; bottom: 18px; }
  :root .hero .acts { width: 100%; flex-wrap: wrap; }
  :root .hero .acts > * { flex: 1 1 auto; justify-content: center; padding: 0 12px; }
}
:root .dot i { background: #c9a374; box-shadow: inset 0 -2px 2px rgba(0,0,0,.3); width: 10px; height: 10px; border-radius: 5px; }
:root .dot[aria-current="true"] i { width: 28px; background: rgba(246,232,203,.45); }

/* ---------- Quick links on a wooden shelf ---------- */
:root .shome .quick { padding: 2px 2px 14px; background: linear-gradient(180deg, var(--c-wood), var(--c-woodDark)) bottom / 100% 9px no-repeat; border-radius: 4px; }
:root .shome .quick .quick-btn { background: var(--felt), linear-gradient(180deg, #a5642b, #82491b); }
:root .quick-btn small { color: #ffe9c4; }

/* ---------- Shelves and game cards ---------- */
:root .shome .shelf h2 { color: #fff6e2; }
:root .shome .shelf h2 small { color: var(--soft); text-shadow: none; }
:root .gcard { border: 4px solid var(--c-cream); border-radius: 18px; box-shadow: 0 4px 0 #b79a6a, 0 10px 20px rgba(0,0,0,.35); }
:root .gcard.big { border-radius: 22px; }
:root .gcard::before { content: ''; position: absolute; inset: 4px; z-index: 1; border: 1.5px dashed var(--c-stitch); border-radius: 11px; pointer-events: none; }
:root .gcard .ttl { left: 12px; right: 12px; bottom: 11px; text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.8); }
:root .gcard.big .ttl { left: 16px; bottom: 15px; }
:root .gcard .bar { left: 8px; right: 8px; bottom: 5px; border-radius: 3px; }
:root .gcard:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

/* ---------- Player menu, game card, preview, sheets: denim with a cream rim ---------- */
:root #pmenu, :root dialog.sheet, :root dialog.gsheet, :root #peek { background: var(--felt), linear-gradient(180deg, var(--c-denim), var(--c-denimDark));
  border: 4px solid var(--c-cream); box-shadow: 0 6px 0 #b79a6a, 0 24px 60px rgba(0,0,0,.55); }
:root #pmenu { outline: 1.5px dashed var(--c-stitch); outline-offset: -8px; padding: 12px; }
:root dialog.sheet form { margin: 6px; padding: 14px 14px 12px; border: 1.5px dashed var(--c-stitch); border-radius: 18px; }
:root #pmenu [role=menuitem] { border-radius: 12px; }
:root #pmenu hr { border-top: 2px dashed var(--c-stitch); opacity: .55; }
:root #pmenu [aria-current="true"] { background: var(--cloth-teal); outline: 1.5px dashed var(--c-stitch); outline-offset: -4px; }
:root #pmenu [role=menuitem]:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
:root .gsheet .media::after { background: linear-gradient(0deg, var(--c-denim) 0, transparent 40%); }
:root dialog::backdrop { background: rgba(7,12,34,.8); }
:root .field, :root select { background: rgba(10,18,48,.55); border: 2px solid rgba(246,232,203,.55); box-shadow: inset 0 3px 8px rgba(0,0,0,.35); }
:root select option { background: var(--c-denimDark); }

/* ---------- Who is playing? ---------- */
:root .face .pic { border: 3px solid var(--c-cream); outline: 1.5px dashed rgba(255,255,255,.85); outline-offset: -9px; box-shadow: var(--puff), 0 6px 0 #b79a6a, 0 14px 26px rgba(0,0,0,.4); }
:root .face.add .pic { background: var(--felt), rgba(51,80,138,.7); border: 2px dashed var(--c-stitch); outline: 0; }

/* ---------- Panels and rows on the other pages ---------- */
:root .row, :root .set, :root .hello, :root .trophy, :root .stat, :root .lvl-block, :root .cal, :root .bpage, :root .item, :root .shero, :root .sshelf,
:root .meta-links .quick-btn, :root .lucky, :root .tile {
  background: var(--felt), linear-gradient(180deg, rgba(62,92,150,.96), rgba(41,62,112,.96)); border: 1.5px solid rgba(10,18,48,.55);
  outline: 1.5px dashed rgba(246,232,203,.5); outline-offset: -6px; box-shadow: 0 3px 0 rgba(0,0,0,.34); /* flat lip: these rows come by the hundred */ }
:root .row, :root .set { padding: 12px 15px; }
:root .row.on, :root .name-pick:has(input:checked) { background: var(--felt), var(--cloth-teal); border: 2px solid var(--c-cream); }
:root .item.on { background: var(--felt), var(--cloth-teal); border: 3px solid var(--c-cream); }
:root .trophy.have { border: 2px solid var(--gold); }
:root .sshelf.gold { border: 2px solid #f5c542; }
:root .bpage { border-top: 6px solid var(--pc); }
:root .st.blank { background: rgba(10,18,48,.4); border: 2px dashed var(--c-stitch); box-shadow: inset 0 3px 8px rgba(0,0,0,.4); color: var(--soft); }
:root .row-text small, :root .soft, :root .stat small, :root .lvl-text small, :root .count, :root .item .price, :root .cal-wd span { color: var(--soft); }
:root .item.on .price, :root .puzzle.done .row-text small, :root .all-done { color: #fff; }
:root .gotd .kicker, :root .streak-line .count, :root .cal-d.today, :root .shero .next, :root .linkish { color: #7ff0df; }
:root .page h2, :root .page .sec, :root .meta .sec { color: #fff3da; }
:root .set.text, :root .note, :root .doc { color: #f2f4ff; }
:root .note { background: var(--felt), rgba(22,34,74,.85); border: 1.5px dashed var(--c-stitch); }
:root .note.hot { background: var(--felt), rgba(126,78,10,.92); }
:root .chip, :root .seg button { background: var(--felt), var(--cloth-blue); border: 0; outline: 1.5px dashed rgba(246,232,203,.55); outline-offset: -4px; box-shadow: var(--puff), var(--lift); }
:root .chip[aria-pressed="true"], :root .seg button[aria-pressed="true"] { background: var(--felt), var(--cloth-teal); color: #fff; box-shadow: var(--puff), 0 0 0 3px var(--c-cream); }
:root .page .icon-btn:not(.top .icon-btn) { background: var(--felt), var(--cloth-blue); }
:root .switch { background: rgba(10,18,48,.6); border: 2px solid rgba(246,232,203,.5); box-shadow: inset 0 3px 6px rgba(0,0,0,.4); }
:root .switch i { width: 22px; height: 22px; margin-top: 0; background: radial-gradient(circle at 35% 30%, #fff, #e3d3b0); box-shadow: 0 2px 4px rgba(0,0,0,.45); }
:root .switch[aria-checked="true"] { background: #1fa597; border-color: var(--c-cream); }
:root .switch[aria-checked="true"] i { background: radial-gradient(circle at 35% 30%, #fff, #f6e8cb); }
:root .bar { background: rgba(10,18,48,.55); box-shadow: inset 0 1px 3px rgba(0,0,0,.45); }
:root .av:not(.big) { background: rgba(10,18,48,.5); }
:root .cup { background: rgba(10,18,48,.55); }
:root .trophy.have .cup { background: linear-gradient(135deg, #fde68a, #f59e0b); }
:root .av-pick { background: var(--felt), rgba(20,34,78,.7); }
:root .av-pick[aria-checked="true"] { background: var(--felt), #1c8a82; border: 2px solid var(--c-cream); }
:root .site-foot { border-top: 2px dashed rgba(246,232,203,.35); }
/* The focus ring wins over every dashed stitch outline above. */
:focus-visible:not(#view) { outline: 3px solid var(--gold) !important; outline-offset: 2px !important; }

@media (forced-colors: active) { :root .top, :root .hero, :root .gcard { box-shadow: none; } }
