/* Shared chrome: buttons, cards, toasts. Each game sets the --accent family in its own stylesheet. */
:root { --bg: #15101f; --panel: #241a33; --panel2: #32244a; --line: #4d3a6b; --text: #f4ecff; --dim: #b6a7cf; --accent: #ffc23d; --accent-ink: #2b1a00; --good: #58e08f; --bad: #ff6470; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none;
  font: 15px/1.35 "Trebuchet MS", Verdana, Arial, sans-serif; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; touch-action: manipulation; }
img, canvas { -webkit-user-drag: none; }
.btn { min-height: 44px; padding: 2px 8px; border-style: solid; border-width: 13px 20px; border-color: transparent; border-image: url(../assets/ui/btn.webp) 24 32 fill stretch; background: none; color: #fff; font-weight: 700; cursor: pointer; text-shadow: 0 1px 2px #000c; line-height: 1.05; }
.btn:hover { border-image-source: url(../assets/ui/btn_on.webp); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.main { border-image-source: url(../assets/ui/btn_main.webp); color: #fff6d8; }
.btn.main:hover { border-image-source: url(../assets/ui/btn_main_on.webp); }
.btn.danger { border-image-source: url(../assets/ui/btn_danger.webp); }
.btn.danger:hover { border-image-source: url(../assets/ui/btn_danger_on.webp); }
.btn[disabled], .btn.off { filter: grayscale(.6) brightness(.82); cursor: default; }
.icon-btn { width: 50px; height: 44px; min-height: 44px; padding: 0; border-width: 8px 12px; display: grid; place-items: center; font-size: 17px; flex: none; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: #0009; animation: fade .16s; }
.card { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; border-style: solid; border-width: 16px; border-color: transparent; border-image: url(../assets/ui/panel.webp) 34 fill stretch; box-shadow: 0 12px 40px #000a; animation: pop .18s; overflow: hidden; }
.card.wide { width: min(760px, 100%); }
.card h2 { margin: 0 0 2px; padding: 4px 10px; font: 700 23px Georgia, "Times New Roman", serif; text-align: center; color: var(--accent); text-shadow: 0 2px 3px #000c; }
.card-body { padding: 6px 12px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; min-height: 0; }
.card-body p { margin: 0 0 9px; }
.card-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 6px 8px 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 7px; background: #0003; border-radius: 11px; }
.row .grow { flex: 1; min-width: 0; }
.row b { display: block; }
.row small { color: var(--dim); display: block; }
.row img { width: 42px; height: 42px; flex: none; }
#toasts { position: fixed; z-index: 60; left: 50%; top: max(58px, env(safe-area-inset-top)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 5px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { padding: 6px 14px; border-radius: 10px; background: #000c; border: 2px solid var(--accent); font-weight: 700; animation: pop .15s; text-align: center; }
.toast.bad { border-color: var(--bad); }
#tog-home { position: fixed; left: 6px; bottom: 6px; z-index: 40; font: bold 11px "Trebuchet MS", Arial, sans-serif; color: #ffe2a8; background: #0008; padding: 3px 8px; border-radius: 6px; text-decoration: none; }
.title-screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 2vh, 16px); padding: 12px; text-align: center; overflow: hidden; }
.title-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.title-screen h1 { margin: 0; padding: 0 .1em; font: 700 clamp(38px, min(12vw, 17vh), 96px)/1.05 Georgia, 'Times New Roman', serif; letter-spacing: 1px; background: linear-gradient(#fff3bf, var(--accent) 52%, #a8560f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #2a1200) drop-shadow(0 6px 12px #000c); }
.title-screen .sub { color: var(--text); font-weight: 700; text-shadow: 0 2px 4px #000; font-size: clamp(13px, 2.8vh, 18px); }
.title-screen .stack { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.title-screen .btn { min-width: 138px; }
#tog-home.in { position: static; white-space: nowrap; flex: none; }
@media (max-width: 620px) { #tog-home.in { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

#boot { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: var(--bg); }
#boot b { font: 700 34px Georgia, serif; color: var(--accent); }
#boot span { width: min(280px, 70vw); height: 10px; border-radius: 6px; background: #0007; overflow: hidden; }
#boot i { display: block; height: 100%; width: 4%; background: var(--accent); transition: width .2s; }
