/* Patchwork - art drawn by js/draw.js: pieces, the bag, how-to diagrams, small icons. Tokens live in style.css.
   Felt-and-linen identity: every piece is a little sewn object. No SVG filters anywhere: texture is image
   patterns (see Draw.defs) laid over flat fills, shading is gradients and stacked low-opacity shadows. */
:root {
  --art-petal: #D9663A;       /* orange-red embroidery petals on the candle */
  --art-ember: #F08A2C;       /* wick glow */
  --art-seam: #BBA98B;
  --art-laurel: #FBE6A0;      /* pale embroidered laurel on the gold coin */
  --art-pip-ring: #5B1A26;    /* dark ring round the level pips on parchment */
  --art-charm-edge: #A48B5E;  /* darker parchment edge so charm patches stand off the linen */
  --art-flame: #F28A1E;       /* candle flame */
  --art-sh: #3A2412;          /* warm dark brown for every soft shadow */
  --art-felt-a: .42;           /* felt fibres over a piece */
  --art-linen-a: .55;         /* linen weave over the bag's panel */
  --art-leather-a: .55;
}

.piece { overflow: visible; }
.piece.silent { filter: grayscale(.92); opacity: .72; }
.zz { fill: var(--ink); font-family: var(--mono); font-weight: 700; opacity: .85; paint-order: stroke; stroke: var(--cream); stroke-width: 2.4px; stroke-linejoin: round; }

/* ---- shared sewing bits ---- */
.pshadow { fill: var(--art-sh); fill-opacity: .3; }
.st { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2.6 2.2; }
.st.thin { stroke-width: 1.1; stroke-dasharray: 2.2 2; }
.st-gl { stroke: var(--felt-gold-l); }
.st-cream { stroke: var(--thread); }
.st-gold { stroke: var(--thread-gold); }
.grain { opacity: var(--art-felt-a); pointer-events: none; }
.tsh { fill: none; stroke: var(--art-sh); opacity: .38; stroke-linecap: round; stroke-linejoin: round; }
.trim { fill: none; stroke: var(--brass-hi); stroke-width: 2; stroke-linecap: round; }
.bead { fill: var(--brass-hi); }
.num { fill: var(--burgundy-d); stroke: var(--burgundy-d); stroke-width: .35px; font-family: var(--display); font-weight: 800; text-anchor: middle; }
.cs { fill: none; stroke: var(--burgundy-d); stroke-width: 1.6; stroke-linecap: round; }

/* ---- states ---- */
.ring, .halo { opacity: 0; transition: opacity .1s; }
.lit .ring { opacity: 1; }
.fuse-target .halo { opacity: 1; }
.rg-glow { fill: var(--glow); opacity: .28; }
.rg-line { fill: none; stroke: var(--glow); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 4 3; }
.rg-ray { fill: none; stroke: var(--glow); stroke-width: 2.2; stroke-linecap: round; }
.halo-fill { fill: var(--ok-soft); stroke: none; }
.halo-line { fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 4 3; }

/* ---- coin ---- */
.coin-disc { fill: var(--felt-gold); }
.coin-edge { fill: none; stroke: var(--felt-gold-d); stroke-width: 1.8; }
.lf-gl { fill: var(--art-laurel); }
.stem-gl { fill: none; stroke: var(--art-laurel); stroke-linecap: round; }

/* ---- candle ---- */
.wax { fill: var(--cream); stroke: var(--cream-d); stroke-width: 1; }
.wax-sh { fill: var(--cream-d); opacity: .55; }
.band { fill: #FBF3DC; stroke: var(--cream-d); stroke-width: 1; }
.wick { fill: none; stroke: var(--leather-d); stroke-linecap: round; }
.ember { fill: var(--art-ember); }
.stem-gr { fill: none; stroke: var(--thread-green); stroke-linecap: round; }
.lf-green { fill: var(--thread-green); }
.petal { fill: var(--art-petal); } .petal-d { fill: var(--art-petal); }
.pistil { fill: var(--thread-gold); }

/* ---- ribbon ---- */
.rib { fill: var(--rose); stroke: var(--rose-d); stroke-width: 1.2; stroke-linejoin: round; }
.vine { fill: none; stroke: var(--thread); stroke-linecap: round; stroke-linejoin: round; }
.vine-lf { fill: var(--thread); }
.medal { fill: var(--cream); stroke: var(--rose-d); stroke-width: 1.2; }

/* ---- jar ---- */
.jar-body { fill: var(--teal); stroke: var(--teal-d); stroke-width: 1.4; }
.jar-hi { fill: none; stroke: var(--teal-l); opacity: .7; stroke-linecap: round; }
.jar-neck { fill: var(--teal-d); opacity: .8; }
.cork { fill: var(--cork); stroke: var(--leather); stroke-width: 1.2; stroke-linejoin: round; }
.cork-d { fill: none; stroke: var(--leather); opacity: .45; stroke-width: 1.2; stroke-linecap: round; }
.twine { fill: none; stroke: var(--cream-d); stroke-linecap: round; stroke-linejoin: round; }
.tag { fill: var(--cream); stroke: var(--cream-d); stroke-width: 1; stroke-linejoin: round; }
.tag-hole { fill: var(--teal-d); }

/* ---- charms (fallback glyph on a brass felt patch, and the pips) ---- */
.cpatch { fill: var(--charm); stroke: var(--charm-d); stroke-width: 1.2; }
.knot { fill: var(--brass-hi); stroke: var(--art-pip-ring); stroke-width: 1; } .knot-c { fill: var(--brass-d); opacity: .7; }
.gc { fill: var(--charm-ink); } .gca { fill: var(--glyph-acc); } .gdf { fill: var(--charm-d); } .pip { fill: var(--charm-ink); opacity: .95; }
.gs { fill: none; stroke: var(--tile-ink); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.gf { fill: var(--tile-ink); }
.gcs { fill: none; stroke: var(--charm-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gcs.thin { stroke-width: 1.2; } .gcs.w3 { stroke-width: 2.8; } .gcs.w4 { stroke-width: 4; } .gcs.acc { stroke: var(--glyph-acc); } .gcs.dash { stroke-dasharray: 2 2; }
.gd { fill: none; stroke: var(--charm-d); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.gd2 { fill: none; stroke: var(--charm-ink); stroke-width: 1; opacity: .6; }
.gc.fade { opacity: .3; }

.spark { fill: #FFF6CF; opacity: 0; animation: twinkle 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.spark.s2 { animation-delay: 1.4s; }

/* ---- the bag ---- */
.bagsvg { overflow: visible; }
.bagshadow { fill: var(--art-sh); }
.bagbody { fill: var(--bagbody); }
.fuzz { opacity: var(--art-felt-a); pointer-events: none; }
.rolled { stroke-width: 2.4; pointer-events: none; }
.stitch { fill: none; stroke: var(--thread-gold); stroke-linecap: round; }
.leath { opacity: var(--art-leather-a); pointer-events: none; }
.strap-st { fill: none; stroke: var(--thread); stroke-width: 1; stroke-dasharray: 3 2.4; stroke-linecap: round; opacity: .55; }
.recess { fill: none; stroke-width: 4; pointer-events: none; }
.pk-felt { opacity: .35; }
.strap { fill: var(--leather); stroke: var(--leather-d); stroke-width: 1.2; }
.tab { fill: var(--leather); stroke: var(--leather-d); stroke-width: 1.1; }
.rivet { fill: var(--brass); stroke: var(--brass-d); stroke-width: 1; } .rivet-hi { fill: var(--brass-hi); }
.dring { fill: none; stroke: var(--brass); }
.panel-sh { fill: var(--olive-d); opacity: .55; }
.linen { fill: var(--slot); stroke: var(--slot); stroke-width: 1; stroke-linejoin: round; }
.weave { opacity: var(--art-linen-a); pointer-events: none; }
.seam { fill: none; stroke: var(--art-seam); stroke-width: 1.1; stroke-dasharray: 3.2 2.8; stroke-linecap: round; }
.seam.edge { stroke: var(--stitch); opacity: .8; }
.dead { fill: var(--dead-fill); }
.hatch { stroke: var(--dead-line); stroke-width: 1.7; fill: none; stroke-linecap: round; }
.pocket { fill: var(--cream); fill-opacity: .14; stroke: var(--thread-gold); stroke-width: 1.8; stroke-dasharray: 4 3; }
.plus { stroke: var(--thread-gold); stroke-width: 2.6; stroke-linecap: round; fill: none; }

/* ---- diagram scenes ---- */
.sghost { fill: none; stroke: var(--stitch); stroke-width: 1.6; stroke-dasharray: 3 3; }
.badge { fill: var(--burgundy); stroke: var(--cream); stroke-width: 1.5; } .badgetxt { fill: var(--cream); font: 700 10px var(--display); text-anchor: middle; }
.arrow { fill: none; stroke: var(--burgundy); stroke-width: 2.6; stroke-linecap: round; } .arrowhalo { fill: none; stroke: var(--cream); stroke-width: 6.5; stroke-linecap: round; }
.arrowhead { fill: var(--burgundy); stroke: var(--cream); stroke-width: 1; }
.stxt { fill: var(--burgundy); font-family: var(--display); font-weight: 800; text-anchor: middle; }
.scene { margin: 0 auto; max-width: 100%; height: auto; overflow: visible; }
.eqbox { fill: var(--cream); stroke: var(--cream-d); stroke-width: 1.4; } .eqbox.acc { fill: var(--felt-gold); stroke: var(--felt-gold-d); }
.eqst { fill: none; stroke: var(--thread-gold); stroke-width: 1.3; stroke-dasharray: 3 2.6; stroke-linecap: round; } .eqst.acc { stroke: var(--felt-gold-l); }
.eqnum { fill: var(--burgundy); font: 800 24px var(--display); text-anchor: middle; } .eqnum.acc { fill: var(--burgundy-d); } .eqnum.big { font-size: 28px; }
.eqlab { fill: var(--muted); font: 600 10px var(--display); text-anchor: middle; text-transform: uppercase; letter-spacing: .08em; } .eqlab.acc { fill: var(--burgundy-d); }
.eqop { fill: var(--burgundy); font: 700 24px var(--display); text-anchor: middle; }
.eqstem { fill: none; stroke: var(--thread-gold); stroke-width: 1.4; stroke-linecap: round; } .eqleaf { fill: var(--thread-gold); }
.coinicon .coin-disc { fill: var(--felt-gold); }
.bs { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.st-tan { stroke: var(--thread-brown); }
.flame { fill: var(--art-ember); }
.num-l { fill: var(--cream); stroke: var(--burgundy-d); stroke-width: 1.6px; paint-order: stroke; }

/* ---- felt patches: every piece is one patch in its material colour ---- */
.m-metal { --p: var(--metal); --pd: var(--metal-d); --pl: var(--metal-l); --nf: var(--burgundy-d); --ns: transparent; }
.m-wax   { --p: var(--wax);   --pd: var(--wax-d);   --pl: var(--wax-l);   --nf: var(--thread); --ns: var(--wax-d); }
.m-cloth { --p: var(--cloth); --pd: var(--cloth-d); --pl: var(--cloth-l); --nf: var(--thread); --ns: var(--cloth-d); }
.m-glass { --p: var(--glass); --pd: var(--glass-d); --pl: var(--glass-l); --nf: var(--thread); --ns: var(--glass-d); }
.m-charm { --p: var(--charm); --pd: var(--art-charm-edge); --pl: #fff; }
.pt-sh { fill: var(--art-sh); }
.pt-body { fill: var(--p); stroke: var(--pd); stroke-width: .8; stroke-linejoin: round; }
.pt-edge { stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.pt-hi { fill: none; stroke: var(--pl); stroke-width: 1.3; stroke-linecap: round; opacity: .7; }
.stc, .stg, .stg-d, .pipe, .pipe-d { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stc { stroke: var(--thread); }
.stg { stroke: var(--thread-gold); }
.stg-d { fill: none; stroke: var(--metal-d); stroke-linecap: round; }
.pipe { stroke: var(--thread-gold); } .pipe-d { stroke: var(--felt-gold-d); opacity: .9; }
.knotg { fill: var(--thread-gold); stroke: var(--pd); stroke-width: .8; }
.knotc { fill: var(--thread); stroke: var(--metal-d); stroke-width: .8; }
.m-charm .stc { stroke: var(--charm-edge); }
/* the shared tier tag (js/draw.js tag()): vanilla leather canvas, stitched inset, burgundy slab numeral */
.tag-sh { fill: var(--art-sh); fill-opacity: .32; }
.tag-bg { fill: var(--cream); stroke: var(--cream-d); stroke-width: .8px; }
.tag-tex { opacity: .55; mix-blend-mode: multiply; pointer-events: none; }
.tag-st { fill: none; stroke: var(--thread-brown); stroke-linecap: round; opacity: .75; }
.pnum.tagnum { fill: var(--burgundy-d); stroke: none; paint-order: normal; }
.pnum { fill: var(--nf); stroke: var(--ns); stroke-width: 1.2px; paint-order: stroke; stroke-linejoin: round; font-family: var(--display); font-weight: 800; text-anchor: middle; }
.m-metal .pnum { stroke-width: .35px; stroke: var(--burgundy-d); paint-order: normal; }
.pipbg { fill: var(--charm); }
.gl-b .gs, .gl-b .gcs { stroke: var(--charm-edge); } .gl-b .gc, .gl-b .gf { fill: var(--charm-edge); }
.gl-b .gd { stroke: var(--charm); } .gl-b .gdf { fill: var(--charm); } .gl-b .gca { fill: var(--burgundy-l); } .gl-b .gcs.acc { stroke: var(--burgundy-l); } .gl-b .gd2 { stroke: var(--charm-edge); }

/* candle motif */
.cwax { fill: var(--cream); stroke: var(--cream-d); stroke-width: 1; }
.cwax-d { fill: var(--cream-d); opacity: .8; }
.cdrip { fill: var(--cream); }
.cband { fill: var(--thread-gold); }
.cwick { fill: none; stroke: var(--wax-d); stroke-linecap: round; }
.cflame { fill: var(--art-flame); stroke: var(--wax-d); stroke-width: .8; stroke-linejoin: round; }
.cflame2 { fill: var(--thread-gold); }
.cflare { fill: none; stroke: var(--thread-gold); stroke-linecap: round; }
.cstar { fill: var(--thread-gold); }
/* ribbon motif */
.vine-fl { fill: var(--thread-gold); stroke: var(--cloth-d); stroke-width: .6; }
/* jar motif */
.jfill { fill: var(--glass-d); opacity: .55; }
.jline { fill: none; stroke: var(--thread); stroke-linejoin: round; }
.jhi { fill: none; stroke: var(--glass-l); stroke-linecap: round; opacity: .9; }
.jlid { fill: var(--thread); stroke: var(--glass-d); stroke-width: .8; }
.jtrim { fill: none; stroke: var(--thread-gold); stroke-linecap: round; }

/* ---- wool: bristles, tangles, yarn ---- */
.bagsvg, .scene { --p: var(--bagbody); --pl: var(--olive-l); --pd: var(--olive-d); }
.fz { fill: none; stroke-linecap: butt; pointer-events: none; }
.fz1 { stroke: var(--p); }
.fz2 { stroke: var(--pl); opacity: .75; }
/* cream and parchment felt use the pale wool tile: the full one greys them */
.m-charm .grain { fill: url(#pr-felt-pale); }
.tg { fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.tg-l { stroke: var(--pl); opacity: .95; }
.tg-d { stroke: var(--pd); opacity: .8; }
.tg-big { stroke-width: 1.4; }
.m-charm .tg-l { stroke: #d8c9a4; opacity: .9; }
.m-charm .tg-d { stroke: var(--art-charm-edge); }
.m-metal .tg-d { stroke: var(--metal-d); }
.thl { fill: none; stroke: #fff; opacity: .4; stroke-linecap: round; pointer-events: none; }
.blanket { fill: none; stroke: var(--olive-d); stroke-width: 1.5; stroke-linecap: round; opacity: .7; pointer-events: none; }
