/* Shelf Control. Warm living room, chunky ink outlines, Grandstander (OFL, bundled in fonts/). */
@font-face { font-family: 'Grandstander'; font-weight: 500; src: url(fonts/grandstander-latin-500-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Grandstander'; font-weight: 800; src: url(fonts/grandstander-latin-800-normal.woff2) format('woff2'); font-display: swap; }
:root { --ink: #2b1d3a; --paper: #fffaf0; --wall: #f6d9a8; --red: #d9536f; --blue: #3a7bd5; --gold: #ffd23a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wall); color: var(--ink); font: 500 16px/1.4 Grandstander, 'Trebuchet MS', system-ui, sans-serif; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
canvas#game { position: fixed; inset: 0; display: block; outline: none; }
button, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; pointer-events: none; }
.h-stat { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 2px 10px; display: flex; flex-direction: column; line-height: 1.1; min-width: 64px; box-shadow: 3px 3px 0 var(--ink); }
.h-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.h-stat b { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.h-strikes { display: flex; gap: 4px; }
.h-strikes i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); }
.h-strikes i.on { background: var(--red); }
.h-mult { background: var(--gold); border: 3px solid var(--ink); border-radius: 10px; padding: 2px 8px; font-weight: 800; }
.h-btns { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
.icon { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink); background: var(--paper); padding: 7px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.icon svg { width: 100%; height: 100%; fill: currentColor; }
.icon .off { display: none; } .icon.off .off { display: inline; } .icon.off .on { display: none; }

#caption { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px; max-width: calc(100% - 32px); text-align: center; font-weight: 800; box-shadow: 4px 4px 0 var(--ink); pointer-events: none; }
#toasts { position: fixed; left: 0; right: 0; top: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 4px 12px; font-weight: 800; animation: pop .25s ease-out; max-width: calc(100% - 32px); text-align: center; overflow-wrap: anywhere; }
.toast.gold { background: var(--gold); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

#menu { position: fixed; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: max(16px, env(safe-area-inset-top)) 16px 24px; background: linear-gradient(rgba(246,217,168,.82), rgba(246,217,168,.55) 55%, rgba(246,217,168,0)); touch-action: pan-y; }
#logo { font-weight: 800; font-size: clamp(40px, 11vw, 76px); line-height: 1; margin: 12px 0 4px; text-shadow: 4px 4px 0 var(--gold); transform: rotate(-2deg); text-align: center; }
#tagline { margin: 6px 0 14px; text-align: center; max-width: 30em; font-size: 17px; }
.m-main { display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); }
.tile { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 12px 16px; border: 4px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 5px 5px 0 var(--ink); cursor: pointer; }
.tile .t { font-weight: 800; font-size: 22px; } .tile .s { font-size: 14px; }
.tile:active, .btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.t-play { background: var(--blue); color: #fff; } .t-daily { background: var(--gold); } .t-chal { background: var(--red); color: #fff; }
#stats { margin: 12px 0 0; font-weight: 800; }
#menuLinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 10px 0 4px; }
.link { background: none; border: 0; padding: 6px 2px; text-decoration: underline; cursor: pointer; font-size: 15px; }
select.link { background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; text-decoration: none; padding: 4px 6px; }
#byline { font-size: 13px; margin: 4px 0 0; opacity: .8; }

#banner, .sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; background: var(--paper); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 7px 7px 0 var(--ink); padding: 16px 20px 18px; text-align: center; touch-action: pan-y; }
#banner h2, .sheet h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.1; }
#banner p { margin: 4px 0; } #banner .big { font-size: 34px; font-weight: 800; }
#bBest.new { display: inline-block; background: var(--gold); border-radius: 8px; padding: 0 8px; font-weight: 800; }
.b-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn { border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 10px 8px; font-weight: 800; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); min-height: 48px; }
.btn.solid { background: var(--blue); color: #fff; }
#pBody { text-align: left; } #pBody p { margin: 8px 0; font-size: 15px; }
#panel .b-btns, #pausePanel .b-btns { grid-template-columns: 1fr; }
button:focus-visible, select:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
@media (max-height: 460px) { #logo { font-size: 38px; margin-top: 4px; } #tagline { margin-bottom: 8px; } .m-main { flex-direction: row; width: min(760px, 100%); } .tile { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (max-width: 430px) {
  #hud { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .h-stat { min-width: 52px; padding: 1px 7px; } .h-stat b { font-size: 19px; } .h-stat span { font-size: 10px; }
  .h-strikes { gap: 3px; } .h-strikes i { width: 16px; height: 16px; border-width: 2px; }
  .h-mult { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 52px); left: 8px; font-size: 14px; }
  .h-btns { gap: 6px; } .icon { width: 40px; height: 40px; padding: 6px; }
}
