/* Golf Solitaire — per-game styles. Layout + cards; theme tokens come from the kit. */
.golf{
  /* Direction 1 "Classic card-table" — research-backed (Tripledot/MobilityWare palette) */
  --cardw: min(12.4vw, 60px);
  --cardh: calc(var(--cardw) * 1.36);          /* real playing-card aspect ~0.733 */
  --felt-a:#2f6b46; --felt-b:#1d5b39; --felt-c:#16482d;
  --frame:#112060;                              /* navy surround/chrome */
  --gold:#ffbf00; --gold-soft:#fdef79;
  --card:#fcfbf7; --ink:#1a1a1a; --red:#c62828;
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 38%, var(--felt-a) 0%, var(--felt-b) 62%, var(--felt-c) 100%);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  overflow: hidden;
  isolation: isolate;
  font-family:"Convergence", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* APP MODE: felt fills the phone; deep navy shows only in the safe-area insets (card-table frame) */
html.tz-app-mode body, html.tz-app-mode .site-main, html.tz-app-mode #game-root{ background:#0b1430 !important; }
html.tz-app-mode .golf{ min-height: calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); border-radius:0; box-shadow:none;
  display:flex; flex-direction:column; justify-content:center; }

/* HUD */
.g-hud{ display:flex; gap:8px; justify-content:center; margin:2px 0 12px; flex-wrap:wrap; padding:0 46px; }
.g-chip{ display:inline-flex; align-items:center; gap:5px; padding:6px 11px; border-radius:8px;
  background: var(--frame); border:1px solid rgba(255,255,255,.14);
  color:#e7ebf6; font-size:12px; font-weight:600; }
.g-chip span{ opacity:.7; font-weight:600; }
.g-chip b{ color:var(--gold-soft); font-variant-numeric: tabular-nums; }
.g-chip.streak b{ color: var(--gold); }
.g-chip .ico{ width:15px; height:15px; }
.g-chip.combo{ transition: transform .2s, background .2s; }
.g-chip.combo.hot{ background: linear-gradient(90deg,#ffb347,#ff7a59); border-color:#ffcaa0; transform: scale(1.05); }
.g-chip.combo.hot b, .g-chip.combo.hot span, .g-chip.combo.hot .ico{ color:#3a1d00; opacity:1; }

/* stock + waste row */
.g-top{ display:flex; align-items:center; justify-content:center; gap: clamp(22px, 9vw, 54px); margin-bottom:14px; }
.g-stock{ width:var(--cardw); height:var(--cardh); border-radius:7px; cursor:pointer;
  background: repeating-linear-gradient(45deg,#1a2a63 0 6px,#112060 6px 12px);
  border:1.5px solid var(--gold-soft); box-shadow: 3px 3px 0 -1px #0d1845, 6px 6px 0 -2px #0a1232, 0 6px 14px rgba(0,0,0,.42);
  display:flex; align-items:center; justify-content:center; position:relative; transition: transform .12s; }
.g-stock:active{ transform: scale(.95); }
.g-stock.empty{ background: rgba(255,255,255,.05); border-style:dashed; cursor:default; box-shadow:none; }
.g-stockcount{ font-size:13px; font-weight:700; color:#fff; background:rgba(0,0,0,.45); border-radius:999px; padding:2px 7px; }
.g-stock.empty .g-stockcount{ opacity:.4; }
.g-wastewrap{ width:var(--cardw); height:var(--cardh); border-radius:9px;
  border:1.5px dashed rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; }
.g-pile{ display:flex; flex-direction:column; align-items:center; gap:5px; }
.g-plabel{ font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#d6eee4; opacity:.6; }

/* tableau */
.g-tableau{ display:flex; gap: clamp(4px, 1.5vw, 9px); justify-content:center; align-items:flex-start; min-height: calc(var(--cardh) * 2.4); }
.g-col{ display:flex; flex-direction:column; align-items:center; width:var(--cardw); }

/* card */
.card{ width:var(--cardw); height:var(--cardh); border-radius:7px;
  background: var(--card); color: var(--ink);
  border:1px solid rgba(0,0,0,.14);
  box-shadow: 0 2px 5px rgba(0,0,0,.30);
  display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1;
  font-weight:700; user-select:none; -webkit-user-select:none; position:relative; }
/* big clear rank in the corner + ONE big centered suit (what matters most). Even padding. */
.card .ix{ position:absolute; top:7%; left:11%; line-height:.86; }
.card .ix b{ font-family:"Bitter", Georgia, "Times New Roman", serif; font-size: calc(var(--cardw) * .54); font-weight:700; }
.card .pip{ position:absolute; inset:0; box-sizing:border-box; padding-top:22%; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.card.red{ color:var(--red); }
.card.fly{ box-shadow:0 10px 24px rgba(0,0,0,.5); pointer-events:none; }   /* the sliding clone during a move */
.suit{ fill:currentColor; display:block; }
.card .pip .suit{ width: calc(var(--cardw) * .50); height: calc(var(--cardw) * .50); }

/* ---- eye-comfort toggle + Calm Night theme (warm, low blue-light, cream cards) ---- */
.g-eye{ position:absolute; top:calc(12px + env(safe-area-inset-top,0px)); right:14px; z-index:3;
  width:34px; height:34px; border-radius:50%; border:1px solid rgba(255,255,255,.2);
  background:var(--frame); color:#f3ecd8; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:transform .12s, background .15s; }
.g-eye:active{ transform:scale(.9); }
.g-eye .ico{ width:17px; height:17px; }
.g-eye .ico-sun{ display:none; }
html.calm .g-eye .ico-moon{ display:none; }
html.calm .g-eye .ico-sun{ display:inline; }
/* Calm Night theme — warm, low blue-light. Only swaps the felt + card tokens (no orbs). */
html.calm .golf{ --felt-a:#3a4a30; --felt-b:#2a3724; --felt-c:#1f2a1b; --ink:#2b2520; --card:#fbf6ea; }
html.calm.tz-app-mode body, html.calm.tz-app-mode .site-main, html.calm.tz-app-mode #game-root{ background:#13180f !important; }
html.calm .card.red{ color:#b1442f; }
html.calm .g-eye{ background:#3a2c1a; color:#ffe0a8; }
html.calm .g-stock{ border-color:#caa86a; background:repeating-linear-gradient(45deg,#3a2c1a 0 6px,#2c2014 6px 12px);
  box-shadow:3px 3px 0 -1px #241a0e, 6px 6px 0 -2px #1a1209, 0 6px 14px rgba(0,0,0,.45); }
.card.slot{ background: rgba(255,255,255,.05); border:1.5px dashed rgba(255,255,255,.16); box-shadow:none; }
.card.big{ width: calc(var(--cardw) * 1.12); height: calc(var(--cardh) * 1.12); box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.card.playable{ cursor:pointer; box-shadow: 0 0 0 2px var(--gold), 0 4px 14px rgba(255,200,90,.45);
  transform: translateY(-2px); transition: transform .1s, box-shadow .1s; }
.card.playable:active{ transform: translateY(0) scale(.97); }
.card.shake{ animation: g-shake .32s; }
@keyframes g-shake{ 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* hint + controls */
.g-hint{ text-align:center; font-size:13px; color:#cdd8d3; opacity:.9; margin:14px 6px 12px; min-height:18px; }
.g-hint.warn{ color:#ffd0a0; }
.g-trust{ text-align:center; font-size:10.5px; color:#cfe0d6; opacity:.5; margin:9px 0 0; letter-spacing:.02em; }
.g-whywrap{ text-align:center; margin:6px 0 0; }
.g-why{ background:rgba(46,194,126,.18); border:1px solid rgba(127,227,180,.55); color:#cdf3df; font-size:12px; font-weight:700; padding:6px 14px; border-radius:999px; cursor:pointer; transition:transform .1s; }
.g-why:active{ transform:scale(.95); }
.g-controls{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.g-btn{ display:inline-flex; align-items:center; gap:6px; padding:9px 14px; border-radius:9px; cursor:pointer;
  background: var(--frame); border:1px solid rgba(255,255,255,.14); color:#e7ebf6;
  font-size:13px; font-weight:700; transition: transform .12s, background .15s; }
.g-btn:active{ transform: scale(.95); }
.g-btn .ico{ width:16px; height:16px; }
.g-btn.primary{ background: var(--gold); border-color:var(--gold-soft); color:#1a1a1a; }
.g-btn.ad{ background: linear-gradient(90deg,#ffb347,#ff8a3d); border-color:#ffcd9a; color:#3a1d00; }
.g-btn.coach{ background: linear-gradient(90deg,#2ec27e,#159b63); border-color:#7fe3b4; color:#08231a; }   /* the teaching CTA — always reachable */
.g-btn.coach.on{ background:#0e3a28; border-color:#2ec27e; color:#7fe3b4; box-shadow:0 0 0 2px rgba(46,194,126,.5); }
.ico{ fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.ico.fill{ fill:currentColor; stroke:none; }

/* win overlay */
#win{ position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; gap:6px; padding:20px; background: rgba(8,18,15,.82); backdrop-filter: blur(6px);
  opacity:0; visibility:hidden; transition: opacity .3s; }
#win.show{ opacity:1; visibility:visible; }
#win h2{ color:#fff; font-size:24px; margin:2px 0; }
#win p{ color:#bfe9cf; font-size:14px; margin:0 0 8px; }

.g-confetti{ position:fixed; top:-20px; width:9px; height:14px; border-radius:2px; z-index:9999; pointer-events:none; }

/* ---- onboarding: How-to sheet (teach newcomers what a card is + the 3 rules) ---- */
.g-btn.ghelp{ width:40px; min-width:40px; padding:9px 0; justify-content:center; font-size:16px; font-weight:800; }
#howto{ position:absolute; inset:0; z-index:6; display:flex; align-items:center; justify-content:center; padding:18px;
  background:rgba(8,18,15,.88); backdrop-filter:blur(6px); opacity:0; visibility:hidden; transition:opacity .25s; }
#howto.show{ opacity:1; visibility:visible; }
.ht-sheet{ position:relative; width:100%; max-width:340px; padding:22px 18px 18px; color:#e7efe9;
  background:linear-gradient(180deg,#143a2f,#0e2620); border:1px solid rgba(255,255,255,.12); border-radius:18px;
  box-shadow:0 20px 50px rgba(0,0,0,.55); }
.ht-x{ position:absolute; top:9px; right:12px; background:none; border:none; color:#cfe7dd; font-size:18px; cursor:pointer; opacity:.7; }
.ht-sheet h2{ margin:0 0 16px; font-size:20px; color:#fff; text-align:center; }
.ht-anatomy{ display:flex; align-items:center; gap:16px; justify-content:center; margin-bottom:16px; }
.card.ht-sample{ width:58px; height:82px; flex:none; box-shadow:0 4px 14px rgba(0,0,0,.4); }
.ht-legend{ display:flex; flex-direction:column; gap:8px; }
.ht-legend p{ margin:0; display:flex; flex-direction:column; font-size:13px; }
.ht-legend p b{ color:#fff; } .ht-legend p span{ opacity:.72; font-size:12px; }
.ht-steps{ margin:0 0 18px; padding-left:20px; display:flex; flex-direction:column; gap:10px; }
.ht-steps li{ font-size:13.5px; line-height:1.35; color:#dbe7e0; }
.ht-steps li b{ color:var(--gold); } .ht-steps li span{ display:block; opacity:.7; font-size:12px; margin-top:2px; }
/* class-1-simple visual rule: 6 <- 7 -> 8 */
.ht-lead{ text-align:center; font-size:14px; margin:0 0 12px; color:#dbe7e0; }
.ht-lead b{ color:#fff; }
.ht-rule{ display:flex; align-items:center; justify-content:center; gap:8px; margin:0 0 14px; }
.ht-mini{ width:40px; height:57px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:21px; font-weight:800; color:#16271f; background:linear-gradient(158deg,#fff,#e7ecf4);
  border:1px solid rgba(22,32,54,.16); box-shadow:0 2px 5px rgba(0,0,0,.3); }
.ht-arrow{ font-size:22px; color:var(--gold); font-weight:800; }
/* full card order, low -> high, for total beginners */
.ht-ladder{ display:flex; justify-content:center; gap:3px; margin:0 0 3px; }
.ht-step{ min-width:17px; height:23px; padding:0 3px; border-radius:5px; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800; color:#16271f; background:linear-gradient(158deg,#fff,#e2e8f1); border:1px solid rgba(22,32,54,.16); }
.ht-step.low{ background:linear-gradient(158deg,#bfe9cf,#8fd9ad); }
.ht-step.high{ background:linear-gradient(158deg,#ffd9a0,#f7b96b); }
.ht-ax{ display:flex; justify-content:space-between; margin:0 4px 10px; font-size:10.5px; color:var(--gold); font-weight:700; opacity:.85; }
.ht-note{ text-align:center; font-size:11.5px; color:#9fb6ab; margin:0 0 14px; line-height:1.4; }
.ht-note b{ color:#dbe7e0; }
.ht-big{ text-align:center; font-size:16px; font-weight:800; color:#fff; margin:0 0 6px; }
.ht-big b{ color:var(--gold); }
.ht-sub{ text-align:center; font-size:12.5px; color:#b9cabf; margin:0 0 16px; line-height:1.45; }
#howto .g-btn.primary{ width:100%; justify-content:center; }
.ht-actions{ display:flex; flex-direction:column; gap:8px; }
.ht-actions .g-btn{ width:100%; justify-content:center; }

/* interactive demo: speech bubble + target highlight + skip */
#demobubble{ position:absolute; z-index:8; max-width:184px; padding:9px 12px; border-radius:12px;
  background:#fff; color:#16271f; font-size:12.5px; font-weight:600; line-height:1.3;
  box-shadow:0 6px 18px rgba(0,0,0,.42); opacity:0; visibility:hidden; transition:opacity .2s; pointer-events:none; }
#demobubble.show{ opacity:1; visibility:visible; }
#demobubble::after{ content:''; position:absolute; left:50%; bottom:-7px; transform:translateX(-50%);
  border:7px solid transparent; border-top-color:#fff; border-bottom:0; }
#demobubble.below::after{ bottom:auto; top:-7px; border-top:0; border-bottom-color:#fff; }
.card.demo-target, .g-stock.demo-target{ box-shadow:0 0 0 3px var(--gold), 0 0 20px rgba(255,210,120,.75) !important; z-index:3;
  animation:demopulse 1s ease-in-out infinite; }
@keyframes demopulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.06); } }
#demoskip{ position:absolute; top:calc(8px + env(safe-area-inset-top,0px)); left:10px; z-index:9;
  background:rgba(0,0,0,.5); color:#fff; border:1px solid rgba(255,255,255,.22); border-radius:999px;
  padding:5px 11px; font-size:12px; font-weight:700; cursor:pointer; opacity:0; visibility:hidden; }
#demoskip.show{ opacity:1; visibility:visible; }
