/* coin-pusher.css — the Kindness Coin Pusher (/coin-pusher.html). Warm wood, brass and cream; a dusk set for dark mode.
   Motion is transforms and opacity only; "Keep the page still" (html.tol-still) and reduced motion stop it. */

.cp{
  --ink:#2B2620; --soft:#5A5346; --line:#D9CBA3; --focus:#2B5B8C;
  --card:#FFFBF1; --card2:#F6EEDC; --edge:#E3D5B2; --btn:#5C2A2E; --btn-ink:#FFF3DC; --pill:#FFFDF7; --pill-ink:#4A2A22;
  --brass:#C99A3E; --wood:#7A4A2B; --felt:#2E5A4E; --stage:#EFE4CF; --glow:rgba(233,196,111,.35);
  font-family:"Lora", Georgia, serif; color:var(--ink);
  max-width:1000px; margin:0 auto; padding:1rem 16px 3rem; box-sizing:border-box; line-height:1.6;
}
body.is-game:has(> main.cp){ background:#F5EFDE; }
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body.is-game:has(> main.cp){ background:#171419; }
  html:not([data-theme="light"]) .cp{
    --ink:#F4EBDD; --soft:#CFC3B2; --line:#4D4038; --focus:#F9D9B8;
    --card:#2A2226; --card2:#33292D; --edge:#4D4038; --btn:#E9C46F; --btn-ink:#2A1B14; --pill:#2E2529; --pill-ink:#F4EBDD;
    --stage:#1F1A22; --glow:rgba(233,196,111,.22);
  }
}
html[data-theme="dark"] body.is-game:has(> main.cp){ background:#171419; }
html[data-theme="dark"] .cp{
  --ink:#F4EBDD; --soft:#CFC3B2; --line:#4D4038; --focus:#F9D9B8;
  --card:#2A2226; --card2:#33292D; --edge:#4D4038; --btn:#E9C46F; --btn-ink:#2A1B14; --pill:#2E2529; --pill-ink:#F4EBDD;
  --stage:#1F1A22; --glow:rgba(233,196,111,.22);
}
.cp *, .cp *::before, .cp *::after{ box-sizing:border-box; }
.cp .sr-only{ position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.cp-skip{ position:absolute; left:-9999px; top:0; z-index:50; background:var(--btn); color:var(--btn-ink); padding:.6rem 1rem; border-radius:0 0 12px 0; }
.cp-skip:focus{ left:0; }

.cp-head{ max-width:46rem; margin:0 auto 1rem; text-align:center; }
.cp-kicker{ margin:0; font:500 .74rem/1.2 "IBM Plex Mono", ui-monospace, monospace; letter-spacing:.12em; text-transform:uppercase; color:var(--soft); }
.cp h1{ font-family:"Fraunces", Georgia, serif; font-weight:500; font-size:clamp(2rem, 6vw, 3rem); line-height:1.1; margin:.25rem 0 .6rem; color:var(--ink); }
.cp h2{ font-family:"Fraunces", Georgia, serif; font-weight:500; font-size:1.45rem; line-height:1.2; margin:0 0 .4rem; color:var(--ink); }
.cp-intro{ margin:0 auto; font-size:1.02rem; color:var(--soft); text-align:left; }
.cp-note{ font-size:.93rem; color:var(--soft); margin:.2rem 0 1rem; }
.cp-center{ text-align:center; max-width:40rem; margin:.8rem auto; }
.cp a{ color:inherit; }

/* buttons: every one at least 44px */
.cp button{ font:inherit; color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.cp :focus-visible{ outline:3px solid var(--focus); outline-offset:3px; border-radius:10px; }
.cp .cp-go{ min-height:48px; padding:.6rem 1.6rem; border-radius:999px; border:0; background:var(--btn); color:var(--btn-ink); font-family:"Fraunces", Georgia, serif; font-weight:500; font-size:1.08rem; box-shadow:0 2px 0 rgba(0,0,0,.18); }
.cp .cp-go[aria-disabled="true"]{ opacity:.55; }
.cp .cp-pill{ min-height:44px; padding:.45rem 1rem; border-radius:999px; border:1px solid var(--line); background:var(--pill); color:var(--pill-ink); font-size:.95rem; }
.cp .cp-pill[aria-pressed="true"]{ border-color:var(--brass); box-shadow:inset 0 0 0 1px var(--brass); }
.cp .cp-pill:disabled{ opacity:.55; cursor:default; }
.cp-bar, .cp-row, .cp-controls{ display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center; align-items:center; }
.cp-bar{ margin:.2rem 0 .6rem; }

/* the machine */
.cp-machine{ position:relative; margin:0 auto; }
.cp-hud{ display:flex; justify-content:space-between; gap:.5rem; margin:0 0 .4rem; }
.cp-chip{ display:inline-flex; align-items:center; gap:.3rem; padding:.25rem .8rem; border-radius:999px; background:var(--card); border:1px solid var(--edge); font-size:.92rem; }
.cp-stage{ position:relative; width:100%; aspect-ratio:16 / 10; max-height:72vh; min-height:300px; border-radius:22px; overflow:hidden; background:var(--stage);
  border:6px solid #7A4A2B; box-shadow:0 0 0 2px var(--brass), 0 12px 32px rgba(60,30,10,.22), 0 0 40px var(--glow); touch-action:manipulation; cursor:crosshair; user-select:none; -webkit-user-select:none; }
@media (max-width:640px){ .cp-stage{ aspect-ratio:5 / 6; max-height:66vh; border-width:4px; border-radius:18px; } }
.cp-stage:focus-visible{ outline:3px solid var(--focus); outline-offset:3px; }
.cp-canvas, .cp-fx{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.cp-fx{ pointer-events:none; z-index:2; }
.cp.is-wild .cp-stage{ animation:cp-glow .5s ease-in-out infinite alternate; }
@keyframes cp-glow{ to{ box-shadow:0 0 0 2px #F3D891, 0 12px 32px rgba(60,30,10,.22), 0 0 70px rgba(255,200,120,.75); } }
.cp-controls{ margin:.7rem 0 .4rem; }
.cp-controls{ flex-wrap:nowrap; }
.cp-controls .cp-go{ min-width:10rem; }
@media (max-width:400px){ .cp-controls{ gap:.35rem; } .cp-controls .cp-go{ min-width:0; flex:1; padding:.6rem .8rem; } .cp-controls .cp-aim{ padding:.45rem .7rem; } }
.cp-empty{ text-align:center; margin:.3rem auto; max-width:34rem; padding:.5rem .9rem; border-radius:14px; background:var(--card2); border:1px solid var(--edge); font-size:.95rem; }
.cp-empty.is-pulse{ animation:cp-pulse .6s ease 2; }
@keyframes cp-pulse{ 50%{ transform:scale(1.03); } }

/* the meter */
.cp-meter-box{ max-width:34rem; margin:.6rem auto 0; text-align:center; }
.cp-meter-label{ margin:0 0 .3rem; display:flex; justify-content:space-between; gap:.6rem; flex-wrap:wrap; font-size:.95rem; }
.cp-meter{ height:14px; border-radius:999px; background:var(--card2); border:1px solid var(--edge); overflow:hidden; }
.cp-meter span{ display:block; height:100%; width:0; background:linear-gradient(90deg, #E9C46F, #F2A98A); border-radius:999px; transition:width .4s ease; }

/* the card that slides up over the machine */
.cp-card{ position:absolute; left:12px; right:12px; bottom:12px; z-index:3; max-width:30rem; margin:0 auto; padding:.9rem 1rem .8rem; border-radius:18px;
  background:var(--card); color:var(--ink); border:2px solid var(--brass); box-shadow:0 10px 30px rgba(40,20,10,.3); cursor:auto;
  transform:translateY(120%); opacity:0; transition:transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .25s; max-height:calc(100% - 24px); overflow:auto; }
.cp-card.is-up{ transform:none; opacity:1; }
.cp-card-k{ margin:0; font:500 .72rem/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing:.08em; text-transform:uppercase; color:var(--soft); }
.cp-card-t{ font-family:"Fraunces", Georgia, serif; font-weight:500; font-size:1.2rem; line-height:1.2; margin:.15rem 0 .3rem; }
.cp-card-b p{ margin:.2rem 0; font-size:.98rem; }
.cp-card-go a{ display:block; padding:.6rem 0; min-height:44px; font-weight:600; }
.cp-card-med{ float:right; width:72px; height:72px; margin:0 0 .3rem .6rem; }
.cp-card-x{ position:absolute; top:6px; right:6px; width:44px; height:44px; padding:0; border-radius:999px; border:1px solid var(--line); background:var(--pill); color:var(--pill-ink); font-size:1.5rem; line-height:1; }
.cp-card-k, .cp-card-t{ padding-right:2.6rem; }
@media (max-width:640px){
  .cp-card{ left:8px; right:8px; bottom:8px; padding:.7rem .8rem .5rem; }
  .cp-card-t{ font-size:1.08rem; }
  .cp-card-b p{ font-size:.93rem; line-height:1.45; }
  .cp-card-med{ width:56px; height:56px; }
}
.cp-card.cp-t2{ border-color:#B9A2D9; }
.cp-card.cp-t3{ border-color:#E2556A; box-shadow:0 10px 30px rgba(40,20,10,.3), 0 0 0 4px rgba(233,196,111,.35); }
.cp-card.cp-prize{ border-color:#E9C46F; background:linear-gradient(180deg, var(--card), var(--card2)); }

/* break, rest, celebration */
.cp-break, .cp-rest, .cp-celebrate{ max-width:36rem; margin:1rem auto; padding:1rem 1.1rem; border-radius:20px; background:var(--card); border:1px solid var(--edge); text-align:center; }
.cp-celebrate{ border:2px solid var(--brass); box-shadow:0 0 40px var(--glow); }
.cp-cel-friends{ display:flex; flex-wrap:wrap; justify-content:center; gap:.3rem; margin:.4rem 0 .6rem; }
.cp-cel-friends img{ width:44px; height:44px; animation:cp-hop .7s ease-in-out infinite alternate; }
@keyframes cp-hop{ to{ transform:translateY(-6px) rotate(6deg); } }

/* the shelf */
.cp-shelf-box-wrap, .cp-tips-wrap{ margin:2rem auto 0; max-width:60rem; }
.cp-shelf{ list-style:none; padding:0; margin:.6rem 0 0; display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:.6rem; }
.cp-shelf li{ margin:0; }
.cp-shelf a, .cp-shelf-box{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:.15rem; min-height:44px; height:100%; padding:.6rem .4rem; border-radius:16px; background:var(--card); border:1px solid var(--edge); text-decoration:none; color:var(--ink); }
.cp-shelf a:hover{ border-color:var(--brass); }
.cp-shelf img{ width:64px; height:64px; }
.cp-shelf-n{ font-weight:600; font-size:.9rem; line-height:1.25; }
.cp-shelf-w{ font-size:.78rem; color:var(--soft); line-height:1.25; }
.cp-shelf .is-missing .cp-shelf-n{ font-weight:400; color:var(--soft); }
.cp-shelf .is-missing img{ opacity:.6; }
.cp-tips{ padding-left:1.1rem; }
.cp-tips li{ margin:.4rem 0; }
.cp-tips a{ display:inline-flex; align-items:center; min-height:44px; font-weight:600; }

/* still: nothing moves */
html.tol-still .cp *, html.tol-still .cp *::before{ animation:none !important; transition:none !important; }
@media (prefers-reduced-motion: reduce){ .cp *, .cp *::before{ animation:none !important; transition:none !important; } }
@media print{ .cp-stage, .cp-controls, .cp-bar{ display:none; } }
