:root.pmg-game-open { overflow: hidden; }
.pmg-game[hidden] { display: none !important; }
.pmg-game { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 18px; color: #f7fbfd; font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.pmg-game * { box-sizing: border-box; }
.pmg-game__backdrop { position: absolute; inset: 0; background: rgba(3, 20, 31, .88); backdrop-filter: blur(10px); }
.pmg-game__shell { position: relative; width: min(820px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid rgba(255,255,255,.16); border-radius: 24px; background: radial-gradient(circle at 80% 0, rgba(74,167,197,.18), transparent 34%), linear-gradient(145deg, #0d334b, #071d2b 68%); box-shadow: 0 30px 90px rgba(0,0,0,.48); padding: 22px; }
.pmg-game__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.pmg-game__eyebrow { color: #f2b441; font-size: .76rem; font-weight: 800; letter-spacing: .14em; }
.pmg-game h2 { margin: 2px 0 0; color: #fff; font: 800 clamp(1.85rem, 5vw, 3rem)/1.05 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.04em; }
.pmg-game__close { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.06); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.pmg-game__close:hover, .pmg-game__close:focus-visible { background: #ec6a3a; outline: 3px solid rgba(242,180,65,.45); }
.pmg-game__found { margin: 10px 0 16px; color: #b9d3df; font-size: .9rem; }
.pmg-game__found strong { color: #fff; }
.pmg-game__layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(210px, 1fr); justify-content: center; gap: 24px; }
.pmg-game__board-wrap { position: relative; }
.pmg-game__board-wrap > canvas { display: block; width: 100%; height: auto; border: 2px solid rgba(242,180,65,.75); border-radius: 10px; box-shadow: 0 12px 38px rgba(0,0,0,.4), 0 0 34px rgba(242,180,65,.09); }
.pmg-game__banner { position: absolute; top: 42%; left: -8px; right: -8px; opacity: 0; transform: scale(.9) rotate(-2deg); background: #f2b441; color: #08273a; padding: 12px 8px; text-align: center; font-weight: 950; letter-spacing: .06em; box-shadow: 0 10px 24px rgba(0,0,0,.35); pointer-events: none; transition: .2s ease; }
.pmg-game__banner.is-visible { opacity: 1; transform: scale(1.03) rotate(-2deg); }
.pmg-game__sidebar { display: flex; flex-direction: column; gap: 14px; }
.pmg-game__status { display: flex; align-items: center; gap: 9px; color: #d9edf5; font-size: .88rem; }
.pmg-game__status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #48a879; box-shadow: 0 0 0 5px rgba(72,168,121,.15); }
.pmg-game__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pmg-game__stats div, .pmg-game__next { border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); padding: 12px; }
.pmg-game__stats small, .pmg-game__next small { display: block; color: #9ebdcb; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.pmg-game__stats strong { display: block; margin-top: 4px; color: #fff; font-size: 1.25rem; }
.pmg-game__next canvas { display: block; margin: 8px auto 0; max-width: 100%; }
.pmg-game__primary, .pmg-game__secondary { min-height: 46px; border-radius: 12px; font: 800 .95rem/1 ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.pmg-game__primary { border: 0; background: #f2b441; color: #08273a; box-shadow: 0 8px 22px rgba(242,180,65,.18); }
.pmg-game__primary:hover, .pmg-game__primary:focus-visible { background: #ffd166; outline: 3px solid rgba(255,255,255,.35); }
.pmg-game__secondary { border: 1px solid rgba(255,255,255,.18); background: transparent; color: #eaf5f9; }
.pmg-game__keys { margin: auto 0 0; color: #9ebdcb; font-size: .78rem; line-height: 1.8; text-align: center; }
.pmg-game__keys span { display: inline-block; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: rgba(255,255,255,.07); padding: 0 6px; color: #fff; }
.pmg-game__touch { display: none; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.pmg-game__touch button { min-height: 48px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(255,255,255,.08); color: #fff; font: 800 .95rem/1 ui-sans-serif, system-ui, sans-serif; touch-action: manipulation; }
.pmg-game__legal { margin: 14px 0 0; color: #7fa3b3; font-size: .7rem; text-align: center; }
.pmg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  .pmg-game { padding: 0; }
  .pmg-game__shell { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; padding: 14px; }
  .pmg-game__layout { grid-template-columns: minmax(175px, 48vw) 1fr; gap: 12px; }
  .pmg-game__stats { grid-template-columns: 1fr; gap: 6px; }
  .pmg-game__stats div { padding: 8px 10px; }
  .pmg-game__stats strong { font-size: 1rem; }
  .pmg-game__next { padding: 8px; }
  .pmg-game__next canvas { height: 50px; }
  .pmg-game__keys { display: none; }
  .pmg-game__touch { display: grid; }
  .pmg-game__legal { margin-top: 8px; }
}
@media (max-height: 720px) and (min-width: 641px) {
  .pmg-game__shell { transform: scale(.88); width: min(880px, 112%); }
}
@media (prefers-reduced-motion: reduce) {
  .pmg-game__banner { transition: none; }
}
