/* Game home pages: every game's start page has the same layout and the same buttons, in the game's own theme.
   Each game sets these on .gh (or :root): --gh-bg --gh-panel --gh-line --gh-text --gh-muted --gh-accent --gh-accent-ink
   --gh-logo-a --gh-logo-b --gh-display --gh-display-weight --gh-body. */
.gh{color:var(--gh-text);font-family:var(--gh-body)}
.gh *,.gh-modal *{box-sizing:border-box}
.gh-wrap{max-width:1040px;margin:0 auto;padding:0 16px}

/* Top bar: back to the games site on the left; sign-in and sound on the right */
.gh-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:4px;min-height:60px}
.gh-back{color:var(--gh-muted);text-decoration:none;font-weight:700;font-size:14px;display:inline-flex;align-items:center;min-height:44px;white-space:nowrap}
.gh-back:hover{color:var(--gh-text)}
body.standalone .gh-back{visibility:hidden}
.gh-tools{display:flex;align-items:center;gap:8px;min-width:0}
.gh-acct{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--gh-muted);min-height:44px;min-width:0}
.gh-acct img{width:30px;height:30px;border-radius:50%;flex:none}
.gh-acct .gh-who{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;color:var(--gh-text)}
.gh-icon{width:44px;height:44px;border-radius:12px;border:1px solid var(--gh-line);background:var(--gh-panel);color:var(--gh-text);display:grid;place-items:center;font-size:18px;cursor:pointer;padding:0;flex:none}
.gh-icon:hover{border-color:var(--gh-muted)}

/* Hero: logo, one paragraph, the four buttons, a note; the game's picture beside it (below on phones) */
.gh-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:36px;align-items:center;padding:18px 0 30px}
.gh-logo{font-family:var(--gh-display);font-weight:var(--gh-display-weight,400);font-size:clamp(54px,9vw,90px);line-height:.95;margin:0 0 16px;letter-spacing:var(--gh-logo-spacing,.01em)}
.gh-logo span{display:block}
.gh-logo .a{color:var(--gh-logo-a)}
.gh-logo .b{color:var(--gh-logo-b);padding-left:.5em}
.gh-lead{font-size:17px;line-height:1.55;color:var(--gh-muted);margin:0 0 22px;max-width:44ch}
.gh-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.gh-btn{font-family:var(--gh-body);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 18px;border-radius:999px;
  border:1px solid var(--gh-line);background:var(--gh-panel);color:var(--gh-text);font-weight:700;font-size:15px;line-height:1.1;cursor:pointer;text-decoration:none;white-space:nowrap}
.gh-btn:hover{border-color:var(--gh-muted)}
.gh-btn:focus-visible,.gh-icon:focus-visible{outline:2px solid var(--gh-accent);outline-offset:2px}
.gh-btn:disabled{opacity:.5;cursor:not-allowed}
.gh-btn svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.gh-btn.primary{background:var(--gh-accent);border-color:var(--gh-accent);color:var(--gh-accent-ink);padding-inline:28px;font-size:17px;box-shadow:0 8px 24px var(--gh-accent-glow,rgba(0,0,0,.25))}
.gh-btn.primary svg{fill:currentColor;stroke:none}
.gh-btn.primary:hover{filter:brightness(1.07)}
.gh-btn.small{min-height:36px;padding:6px 14px;font-size:13px}
.gh-note{color:var(--gh-muted);font-size:14px;margin:14px 0 0;max-width:46ch}
.gh-art{min-width:0;display:flex;justify-content:center}
.gh-art > *{width:100%;border-radius:20px;border:1px solid var(--gh-line);display:block}

/* iPhone: Add to Home Screen tip */
.gh-ios{display:flex;align-items:center;gap:10px;justify-content:space-between;background:var(--gh-panel);border:1px solid var(--gh-line);border-radius:14px;padding:8px 8px 8px 14px;margin:0 0 26px;font-size:14px;color:var(--gh-text)}
.gh-ios .gh-icon{width:36px;height:36px;font-size:14px}

.gh-foot{color:var(--gh-muted);opacity:.75;font-size:13px;padding:28px 0 max(28px,env(safe-area-inset-bottom))}

/* Dialogs (How to play, Leaderboard) */
.gh-modal{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.62);display:grid;place-items:center;padding:16px;font-family:var(--gh-body)}
.gh-sheet{width:100%;max-width:500px;max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;background:var(--gh-panel);border:1px solid var(--gh-line);border-radius:22px;padding:20px 22px 22px;color:var(--gh-text);box-shadow:0 24px 60px rgba(0,0,0,.5)}
.gh-sheet-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.gh-sheet h2{margin:0;font-family:var(--gh-display);font-weight:var(--gh-display-weight,400);font-size:26px;line-height:1.1}
.gh-sheet h3{margin:18px 0 6px;font-size:13px;letter-spacing:.12em;text-transform:uppercase;color:var(--gh-accent)}
.gh-sheet p,.gh-sheet li{color:var(--gh-muted);font-size:15px;line-height:1.5}
.gh-sheet p{margin:0 0 10px}
.gh-sheet ul,.gh-sheet ol{margin:0 0 10px;padding-left:20px}
.gh-sheet li{margin-bottom:4px}
.gh-sheet strong,.gh-sheet b{color:var(--gh-text)}
.gh-sheet kbd{font-family:var(--gh-body);font-size:12px;background:var(--gh-bg);border:1px solid var(--gh-line);border-bottom-width:2px;border-radius:5px;padding:1px 6px;color:var(--gh-text);white-space:nowrap}

/* Leaderboard list, shared by games that don't already have their own */
.gh-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 12px}
.gh-tabs button{font:inherit;background:var(--gh-bg);border:1px solid var(--gh-line);border-radius:999px;padding:6px 12px;font-size:13px;font-weight:700;color:var(--gh-muted);cursor:pointer}
.gh-tabs button[aria-selected="true"]{background:var(--gh-accent);border-color:var(--gh-accent);color:var(--gh-accent-ink)}
.gh-board,.gh-sheet .gh-board{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.gh-board li{display:grid;grid-template-columns:26px 30px minmax(0,1fr) auto;align-items:center;gap:10px;background:var(--gh-bg);border:1px solid var(--gh-line);border-radius:12px;padding:7px 10px;color:var(--gh-text);margin:0;font-size:15px}
.gh-board li.me{border-color:var(--gh-accent)}
.gh-board .rk{font-weight:800;text-align:center;color:var(--gh-muted)}
.gh-board li:first-child .rk{color:var(--gh-accent)}
.gh-board .av{width:30px;height:30px;border-radius:50%;background:var(--gh-line);display:grid;place-items:center;font-weight:800;font-size:13px;overflow:hidden}
.gh-board .av img{width:100%;height:100%;object-fit:cover}
.gh-board .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.gh-board .sc{font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap}
.gh-board .sc small{font-weight:600;color:var(--gh-muted)}
.gh-board li.gh-empty{display:block;color:var(--gh-muted);background:none;border:0;padding:6px 2px}

@media (max-width:760px){
  .gh-hero{grid-template-columns:1fr;gap:24px;padding-top:6px}
  .gh-lead{font-size:16px}
  .gh-acct .gh-who{display:none}
}
/* Phones: Play across the full width, then the other buttons two to a row */
@media (max-width:560px){
  .gh-actions{display:grid;grid-template-columns:1fr 1fr}
  .gh-actions .gh-btn{padding-inline:12px}
  .gh-actions .gh-btn.primary,.gh-actions .gh-btn.wide{grid-column:1/-1}
}

/* Header controls wrap instead of pushing beyond a phone viewport. */
.gh-top{flex-wrap:wrap}
.gh-tools{max-width:100%;flex-wrap:wrap}
.gh-top>*,.gh-hero>*,.gh-actions>*{min-width:0}
@media(max-width:480px){.gh-top .gh-tools{margin-left:auto}.gh-acct{max-width:100%}.gh-who{max-width:120px}}

@media(max-width:480px){.gh-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.gh-hero{grid-template-columns:minmax(0,1fr)}.gh-actions .gh-btn{max-width:100%;white-space:normal}}
