/* Loop Games shared shell. Only the top bar, footer, modal, toast, share grid and a few utilities live here.
   Each game owns its own palette and fonts via its own <style>. Override --lp-* tokens per page if needed. */
:root {
  --lp-bar-bg: rgba(10, 12, 20, 0.85);
  --lp-bar-fg: #f4f4f8;
  --lp-bar-h: 52px;
  --lp-accent: #f5b942;
  --lp-modal-bg: #14161f;
  --lp-modal-fg: #f4f4f8;
  --lp-radius: 14px;
  --lp-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; font-family: var(--lp-font); -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
.lp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.lp-bar { position: sticky; top: 0; z-index: 50; height: var(--lp-bar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--lp-bar-bg); color: var(--lp-bar-fg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lp-bar a.lp-home { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; letter-spacing: .3px; font-size: 15px; }
.lp-bar .lp-logo { width: 24px; height: 24px; border-radius: 7px; background: conic-gradient(from 90deg, var(--lp-accent), #ff6b35, #a78bfa, var(--lp-accent)); display: inline-block; }
.lp-bar .lp-title { flex: 1; text-align: center; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-bar .lp-ib { width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: inherit; display: grid; place-items: center; font-size: 18px; }
.lp-bar .lp-ib:active { transform: scale(.94); }
.lp-bar .lp-ib svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Footer / cross-promo */
.lp-foot { padding: 28px 16px 40px; color: var(--lp-bar-fg); background: var(--lp-bar-bg); font-size: 13px; }
.lp-foot h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; opacity: .7; }
.lp-foot .lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 18px; }
.lp-foot .lp-grid a { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); text-decoration: none; border-left: 4px solid var(--c, var(--lp-accent)); }
.lp-foot .lp-grid a b { display: block; font-size: 13px; }
.lp-foot .lp-grid a span { opacity: .65; font-size: 11px; }
.lp-foot .lp-links { display: flex; flex-wrap: wrap; gap: 14px; opacity: .7; }
.lp-foot .lp-links a { text-decoration: none; }

/* Modal */
.lp-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); padding: 0; animation: lp-fade .18s ease; }
.lp-modal .lp-sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; background: var(--lp-modal-bg); color: var(--lp-modal-fg);
  border-radius: var(--lp-radius) var(--lp-radius) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); animation: lp-up .22s cubic-bezier(.2,.8,.2,1); position: relative; }
@media (min-width: 560px) { .lp-modal { align-items: center; padding: 16px; } .lp-modal .lp-sheet { border-radius: var(--lp-radius); } }
.lp-modal .lp-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: inherit; font-size: 18px; }
.lp-modal h2 { margin: 4px 0 12px; font-size: 20px; }
.lp-modal p { line-height: 1.5; margin: 8px 0; }
@keyframes lp-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes lp-up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Buttons */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--lp-accent); color: #111; font-weight: 800; font-size: 15px; text-decoration: none; }
.lp-btn:active { transform: scale(.97); }
.lp-btn.lp-ghost { background: rgba(255,255,255,.1); color: inherit; }
.lp-btn.lp-wide { width: 100%; }
.lp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-row > .lp-btn { flex: 1; }

/* Toast */
.lp-toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 120; background: #fff; color: #111; padding: 10px 16px;
  border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.35); animation: lp-fade .15s; pointer-events: none; }

/* Stats */
.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 12px 0; }
.lp-stats b { display: block; font-size: 24px; }
.lp-stats span { font-size: 11px; opacity: .7; }
.lp-countdown { text-align: center; font-size: 14px; opacity: .8; margin-top: 8px; }
.lp-countdown b { font-variant-numeric: tabular-nums; }

/* Ad overlay (placeholder + real wrapper) */
.lp-ad { position: fixed; inset: 0; z-index: 200; background: #0b0b0f; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.lp-ad .lp-ad-box { width: min(90vw, 360px); aspect-ratio: 9/14; border-radius: 16px; background: repeating-linear-gradient(45deg, #1b1b25 0 12px, #15151d 12px 24px); display: grid; place-items: center; font-weight: 800; letter-spacing: 1px; opacity: .9; }
.lp-ad .lp-ad-label { font-size: 12px; opacity: .6; margin-top: 10px; }
.lp-ad .lp-ad-skip { margin-top: 18px; }
.lp-ad .lp-ad-timer { font-variant-numeric: tabular-nums; }

/* Banner ad slot (daily games) */
.lp-banner { margin: 16px auto; width: 100%; max-width: 728px; min-height: 90px; display: grid; place-items: center; font-size: 11px; opacity: .5; border: 1px dashed rgba(128,128,128,.4); border-radius: 8px; }
.lp-banner:empty::after { content: "advertisement"; }

/* Install banner */
.lp-install { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; color: #111; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: lp-up .3s; }
.lp-install b { flex: 1; font-size: 14px; }
.lp-install .lp-btn { min-height: 38px; padding: 0 14px; font-size: 13px; }

.lp-wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
