/* Folding buttons on every game screen (Doug, 6 Nov 2026, 11:17pm). Each game's buttons in its own look:
   gin = playing cards with the four suits, chess = a board square with a piece, checkers = checkers,
   Hangman = purple and gold letter tiles, Four in a Row = a teal board with dropped discs, backgammon = its points. */
.folded .ckgrid{display:block}
.folded>.card.fold{margin:0 0 10px;padding:0;overflow:hidden}
.folded>.card.fold[hidden]{display:none}
.folded .foldh{display:none}
.folded .foldinner{margin:0;padding:0;background:none;box-shadow:none}
.folded .foldinner>summary{display:none}
.folded .foldbody{padding:6px 18px 18px}
.folded .foldbody[hidden]{display:none}
.folded button.foldbtn{display:flex;align-items:center;gap:14px;width:100%;min-height:66px;margin:0;padding:10px 16px;border-radius:16px;border:0;
  background:transparent;color:var(--paint);font:inherit;text-align:left;box-shadow:none;cursor:pointer}
.folded .foldbtn .ft{flex:1;min-width:0;font-family:var(--display);font-weight:700;font-size:clamp(19px,5vw,22px);line-height:1.2}
.folded .foldbtn .fs{flex:none;font-size:14px;font-weight:700;border-radius:999px;padding:3px 11px;background:rgba(240,210,150,.92);color:#2A1A0F;white-space:nowrap}
.folded .foldbtn .fs:empty{display:none}
.fsred{white-space:nowrap;flex:none}
.folded .foldbtn .fs.red,.fsred{background:#c62828 !important;color:#fff !important}
.folded .foldbtn .fx,.fold-bars .opth .fx{flex:none;width:30px;height:30px;position:relative}
.folded .foldbtn .fx::before,.folded .foldbtn .fx::after,.fold-bars .opth .fx::before,.fold-bars .opth .fx::after{content:"";position:absolute;left:6px;right:6px;top:14px;height:3px;border-radius:2px;background:currentColor}
.folded .foldbtn .fx::after,.fold-bars .opth .fx::after{transform:rotate(90deg);transition:transform .15s}
.folded .fold.open>.foldbtn .fx::after,.fold-bars .opt.open .opth .fx::after{transform:rotate(0)}
.folded .fi{flex:none;display:flex;align-items:center;justify-content:center}
.folded .fsignin .fs{background:var(--paint)}

/* Gin: each button is a playing card, its suit in the corner */
.fold-gin>.card.fold{background:transparent;box-shadow:none;overflow:visible}
.fold-gin button.foldbtn{background:linear-gradient(170deg,#fffdf7,#f1e6cc);color:#1d1d1d;border:2px solid #d8c69e;box-shadow:0 4px 10px rgba(26,15,8,.28);position:relative}
.fold-gin .fcard{width:40px;height:54px;border-radius:7px;background:#fff;border:2px solid #cdb98d;display:flex;align-items:center;justify-content:center;color:#1d1d1d}
.fold-gin .fcard b{font-size:30px;line-height:1}
.fold-gin .fcard.red{color:#c0392b}
.fold-gin .fold.open>.foldbtn{border-radius:16px 16px 0 0}
.fold-gin .foldbody{background:linear-gradient(160deg,#33200f,#24150b);border-radius:0 0 16px 16px;margin:0 4px;box-shadow:inset 0 0 0 1px rgba(230,182,82,.14)}

/* Chess: a board square with its piece */
.fold-ch>.card.fold{box-shadow:inset 0 0 0 2px rgba(236,208,158,.35)}
.fold-ch .fsq{width:46px;height:46px;border-radius:8px;background:conic-gradient(#ecd09e 0 25%,#b07a3c 0 50%,#ecd09e 0 75%,#b07a3c 0);display:flex;align-items:center;justify-content:center;font-size:32px;line-height:1;color:#1f1208;text-shadow:0 0 2px #fff,0 0 4px #fff}

/* Checkers: a checker */
.fold-ck>.card.fold{box-shadow:inset 0 0 0 2px rgba(198,40,40,.45)}
.fold-ck .fdisc{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;color:#2A1A0F;
  box-shadow:inset 0 0 0 4px rgba(0,0,0,.25),inset 0 0 0 8px rgba(255,255,255,.12),0 2px 4px rgba(0,0,0,.5)}
.fold-ck .fdisc.red{background:radial-gradient(circle at 40% 35%,#e0534a,#a61d18)}
.fold-ck .fdisc.black{background:radial-gradient(circle at 40% 35%,#555,#111)}
.fold-ck .fdisc.gold{background:radial-gradient(circle at 40% 35%,#ffe08a,#c99a2e)}

/* Hangman: purple with gold letter tiles */
.fold-hg>.card.fold{background:linear-gradient(160deg,#4a2a6a,#2e1846);box-shadow:inset 0 0 0 2px rgba(230,182,82,.45)}
.fold-hg .ftile{width:44px;height:44px;border-radius:8px;background:linear-gradient(#f6d77a,#d9a92e);color:#2e1846;font-family:var(--display);font-weight:800;font-size:26px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 0 #8a6516}

/* Four in a Row: the teal board with a dropped disc */
.fold-f4>.card.fold{background:linear-gradient(160deg,#126b70,#0b4a4e);box-shadow:inset 0 0 0 2px rgba(255,255,255,.18)}
.fold-f4 .fdrop{width:44px;height:44px;border-radius:50%;box-shadow:inset 0 0 0 4px rgba(0,0,0,.2),0 2px 4px rgba(0,0,0,.4)}
.fold-f4 .fdrop.gold{background:radial-gradient(circle at 40% 35%,#ffe08a,#d9a92e)}
.fold-f4 .fdrop.red{background:radial-gradient(circle at 40% 35%,#e0534a,#a61d18)}

/* Backgammon and Home: their point-shaped bars open and close */
.fold-bars .opt.fold{padding:8px 12px}
.fold-bars .opt.fold .opth{cursor:pointer;margin-bottom:0}
.fold-bars .opt.fold.open .opth{margin-bottom:8px}
.fold-bars .opth .fx{margin-left:8px;color:#2A1A0F}
.fold-bars .opth .osnip+.fx{margin-left:8px}
.fold-bars .opth .osnip:not(:empty)~.fx{margin-left:8px}
.fold-bars .opth:not(:has(.osnip:not(:empty))) .fx{margin-left:auto}
.fold-bars .optb[hidden]{display:none}

/* the name boxes keep their look out of the old grid */
.folded .newmatch input{font:inherit;font-size:16px;padding:10px 12px;border-radius:10px;border:2px solid #6b4a2b;background:#1a0f08;color:#F5EAD3;flex:1;min-width:120px}

/* Faint pictures of each game on the tan behind its buttons (Doug, 7 Nov 2026, 12:03pm). Written by
   tools/fold-bg.py. Only behind the menu (it is hidden while you play); the play screens keep their own look. */
.folded::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.11;background-repeat:repeat}
.fold-gin::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22 viewBox=%220 0 220 220%22%3E%3Crect x=%2218%22 y=%2220%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(-12 47 60)%22/%3E%3Ctext x=%2247%22 y=%2274%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(-12 47 74)%22%3E%E2%99%A0%3C/text%3E%3Ctext x=%22160%22 y=%2260%22 font-size=%2240%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(10 160 60)%22%3E%E2%99%A5%3C/text%3E%3Ctext x=%2270%22 y=%22180%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(-6 70 180)%22%3E%E2%99%A6%3C/text%3E%3Crect x=%22132%22 y=%22122%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(14 161 162)%22/%3E%3Ctext x=%22161%22 y=%22176%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(14 161 176)%22%3E%E2%99%A3%3C/text%3E%3C/svg%3E");background-size:220px auto}
.fold-ct::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22 viewBox=%220 0 220 220%22%3E%3Crect x=%2218%22 y=%2220%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(-12 47 60)%22/%3E%3Ctext x=%2247%22 y=%2274%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(-12 47 74)%22%3E%E2%99%A0%3C/text%3E%3Ctext x=%22160%22 y=%2260%22 font-size=%2240%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(10 160 60)%22%3E%E2%99%A5%3C/text%3E%3Ctext x=%2270%22 y=%22180%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(-6 70 180)%22%3E%E2%99%A6%3C/text%3E%3Crect x=%22132%22 y=%22122%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(14 161 162)%22/%3E%3Ctext x=%22161%22 y=%22176%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(14 161 176)%22%3E%E2%99%A3%3C/text%3E%3C/svg%3E");background-size:220px auto}
.fold-cd::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22 viewBox=%220 0 220 220%22%3E%3Crect x=%2218%22 y=%2220%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(-12 47 60)%22/%3E%3Ctext x=%2247%22 y=%2274%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(-12 47 74)%22%3E%E2%99%A0%3C/text%3E%3Ctext x=%22160%22 y=%2260%22 font-size=%2240%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(10 160 60)%22%3E%E2%99%A5%3C/text%3E%3Ctext x=%2270%22 y=%22180%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(-6 70 180)%22%3E%E2%99%A6%3C/text%3E%3Crect x=%22132%22 y=%22122%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(14 161 162)%22/%3E%3Ctext x=%22161%22 y=%22176%22 font-size=%2238%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(14 161 176)%22%3E%E2%99%A3%3C/text%3E%3C/svg%3E");background-size:220px auto}
.fold-ch::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22200%22 height=%22200%22 viewBox=%220 0 200 200%22%3E%3Crect width=%2250%22 height=%2250%22 fill=%22%235a3a1c%22 fill-opacity=%22.5%22/%3E%3Crect x=%2250%22 y=%2250%22 width=%2250%22 height=%2250%22 fill=%22%235a3a1c%22 fill-opacity=%22.5%22/%3E%3Ctext x=%22150%22 y=%2242%22 font-size=%2244%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 150 42)%22%3E%E2%99%9E%3C/text%3E%3Ctext x=%22150%22 y=%22140%22 font-size=%2240%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 150 140)%22%3E%E2%99%9C%3C/text%3E%3Ctext x=%2250%22 y=%22140%22 font-size=%2244%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 50 140)%22%3E%E2%99%9B%3C/text%3E%3Ctext x=%2225%22 y=%22190%22 font-size=%2230%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 25 190)%22%3E%E2%99%9F%3C/text%3E%3Ctext x=%22175%22 y=%22190%22 font-size=%2230%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 175 190)%22%3E%E2%99%9D%3C/text%3E%3C/svg%3E");background-size:200px auto}
.fold-ck::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22 viewBox=%220 0 160 160%22%3E%3Crect width=%2240%22 height=%2240%22 fill=%22%235a3a1c%22 fill-opacity=%22.45%22/%3E%3Crect x=%2240%22 y=%2240%22 width=%2240%22 height=%2240%22 fill=%22%235a3a1c%22 fill-opacity=%22.45%22/%3E%3Ccircle cx=%22120%22 cy=%2240%22 r=%2217%22 fill=%22%238a2a20%22/%3E%3Ccircle cx=%22120%22 cy=%2240%22 r=%2211%22 fill=%22none%22 stroke=%22%23f3e2c0%22 stroke-opacity=%22.55%22 stroke-width=%222%22/%3E%3Ccircle cx=%2240%22 cy=%22120%22 r=%2217%22 fill=%22%231d120a%22/%3E%3Ccircle cx=%2240%22 cy=%22120%22 r=%2211%22 fill=%22none%22 stroke=%22%23f3e2c0%22 stroke-opacity=%22.55%22 stroke-width=%222%22/%3E%3Ccircle cx=%22120%22 cy=%22125%22 r=%2217%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22/%3E%3C/svg%3E");background-size:160px auto}
.fold-hg::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22210%22 height=%22210%22 viewBox=%220 0 210 210%22%3E%3Crect x=%2214%22 y=%2216%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%234a2a6a%22 transform=%22rotate(0 34 36)%22/%3E%3Ctext x=%2234%22 y=%2246%22 font-size=%2228%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%23c99a2e%22 transform=%22rotate(0 34 46)%22%3EA%3C/text%3E%3Crect x=%22130%22 y=%2240%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%234a2a6a%22 transform=%22rotate(8 150 60)%22/%3E%3Ctext x=%22150%22 y=%2270%22 font-size=%2228%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%23c99a2e%22 transform=%22rotate(8 150 70)%22%3EG%3C/text%3E%3Crect x=%2260%22 y=%22138%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%234a2a6a%22 transform=%22rotate(-8 80 158)%22/%3E%3Ctext x=%2280%22 y=%22168%22 font-size=%2228%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%23c99a2e%22 transform=%22rotate(-8 80 168)%22%3ER%3C/text%3E%3Cpath d=%22M150 200 V130 H185 V142%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%224%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M138 200 H164%22 stroke=%22%235a3a1c%22 stroke-width=%224%22 stroke-linecap=%22round%22/%3E%3Ctext x=%2234%22 y=%22112%22 font-size=%2222%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 34 112)%22%3E_ _ _%3C/text%3E%3C/svg%3E");background-size:210px auto}
.fold-f4::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22180%22 height=%22180%22 viewBox=%220 0 180 180%22%3E%3Ccircle cx=%2240%22 cy=%2240%22 r=%2215%22 fill=%22none%22 stroke=%22%230b4a4e%22 stroke-width=%223%22/%3E%3Ccircle cx=%22130%22 cy=%2260%22 r=%2215%22 fill=%22%23c99a2e%22/%3E%3Ccircle cx=%2260%22 cy=%22140%22 r=%2215%22 fill=%22%238a2a20%22/%3E%3Ccircle cx=%22150%22 cy=%22150%22 r=%2215%22 fill=%22none%22 stroke=%22%230b4a4e%22 stroke-width=%223%22/%3E%3C/svg%3E");background-size:180px auto}
.fold-mj::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22 viewBox=%220 0 220 220%22%3E%3Crect x=%2220%22 y=%2218%22 width=%2244%22 height=%2258%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222.5%22 transform=%22rotate(-10 42 47)%22/%3E%3Ccircle cx=%2242%22 cy=%2247%22 r=%2211%22 fill=%22none%22 stroke=%22%238a2a20%22 stroke-width=%223%22 transform=%22rotate(-10 42 47)%22/%3E%3Crect x=%22140%22 y=%2260%22 width=%2244%22 height=%2258%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222.5%22 transform=%22rotate(8 162 89)%22/%3E%3Ctext x=%22162%22 y=%22100%22 font-size=%2230%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(8 162 100)%22%3E%E4%B8%AD%3C/text%3E%3Crect x=%2260%22 y=%22140%22 width=%2244%22 height=%2258%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222.5%22 transform=%22rotate(4 82 169)%22/%3E%3Cpath d=%22M76 152v34M88 152v34%22 stroke=%22%230b4a4e%22 stroke-width=%225%22 stroke-linecap=%22round%22 transform=%22rotate(4 82 169)%22/%3E%3C/svg%3E");background-size:220px auto}
.fold-bg::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22240%22 height=%22300%22 viewBox=%220 0 240 300%22%3E%3Cpath d=%22M0 0 L20 120 L40 0Z%22 fill=%22%238a2a20%22/%3E%3Cpath d=%22M40 0 L60 120 L80 0Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M80 0 L100 120 L120 0Z%22 fill=%22%238a2a20%22/%3E%3Cpath d=%22M120 0 L140 120 L160 0Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M160 0 L180 120 L200 0Z%22 fill=%22%238a2a20%22/%3E%3Cpath d=%22M200 0 L220 120 L240 0Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M0 300 L20 180 L40 300Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M40 300 L60 180 L80 300Z%22 fill=%22%238a2a20%22/%3E%3Cpath d=%22M80 300 L100 180 L120 300Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M120 300 L140 180 L160 300Z%22 fill=%22%238a2a20%22/%3E%3Cpath d=%22M160 300 L180 180 L200 300Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M200 300 L220 180 L240 300Z%22 fill=%22%238a2a20%22/%3E%3Ccircle cx=%2260%22 cy=%22150%22 r=%2213%22 fill=%22%23f3e2c0%22 stroke=%22%235a3a1c%22 stroke-width=%222%22/%3E%3Ccircle cx=%22180%22 cy=%22150%22 r=%2213%22 fill=%22%235a3a1c%22/%3E%3C/svg%3E");background-size:240px auto}
.fold-home::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22260%22 height=%22260%22 viewBox=%220 0 260 260%22%3E%3Crect x=%2216%22 y=%2218%22 width=%2258%22 height=%2280%22 rx=%227%22 fill=%22none%22 stroke=%22%235a3a1c%22 stroke-width=%222%22 transform=%22rotate(-10 45 58)%22/%3E%3Ctext x=%2245%22 y=%2272%22 font-size=%2236%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%238a2a20%22 transform=%22rotate(-10 45 72)%22%3E%E2%99%A5%3C/text%3E%3Ctext x=%22190%22 y=%2270%22 font-size=%2250%22 font-family=%22serif%22 text-anchor=%22middle%22 fill=%22%235a3a1c%22 transform=%22rotate(0 190 70)%22%3E%E2%99%9E%3C/text%3E%3Ccircle cx=%2260%22 cy=%22200%22 r=%2217%22 fill=%22%238a2a20%22/%3E%3Ccircle cx=%2260%22 cy=%22200%22 r=%2211%22 fill=%22none%22 stroke=%22%23f3e2c0%22 stroke-opacity=%22.55%22 stroke-width=%222%22/%3E%3Cpath d=%22M150 260 L172 160 L194 260Z%22 fill=%22%235a3a1c%22/%3E%3Cpath d=%22M206 196 h36 l8 18 h-52Z%22 fill=%22%23c99a2e%22/%3E%3Cpath d=%22M200 214 h52%22 stroke=%22%235a3a1c%22 stroke-width=%222%22/%3E%3C/svg%3E");background-size:260px auto}
.fold-gin::before,.fold-ct::before,.fold-cd::before{opacity:.15}
