/* Jumplin PWA: install banner / iOS tip / update toast / install menu items */
#pwa-menu-install, #pwa-hdr-install { display: none !important; }
html.pwa-can-install #pwa-menu-install, html.pwa-ios #pwa-menu-install { display: block !important; }
@media (min-width: 768px) { html.pwa-can-install #pwa-hdr-install { display: inline-flex !important; } }
html.pwa-standalone #pwa-menu-install, html.pwa-standalone #pwa-hdr-install, html.pwa-standalone #pwa-banner { display: none !important; }

#pwa-banner { margin: 0 auto 14px; max-width: 560px; }
#pwa-banner.hidden { display: none; }
.pwa-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff;
  border: 2px solid rgba(133, 77, 14, .18); border-radius: 18px; box-shadow: 0 6px 18px -8px rgba(113, 63, 18, .35);
  animation: pwa-in .28s ease-out both; }
@keyframes pwa-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pwa-card, .pwa-toast { animation: none; } }
.pwa-card .pwa-ico { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(113, 63, 18, .25); }
.pwa-card .pwa-txt { flex: 1; min-width: 0; line-height: 1.25; }
.pwa-card .pwa-t { font-weight: 800; font-size: 14px; color: #713f12; }
.pwa-card .pwa-s { font-size: 12px; font-weight: 600; color: #854d0e; opacity: .85; margin-top: 2px; }
.pwa-card .pwa-go { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 800; font-size: 13px;
  color: #fff; background: linear-gradient(90deg, #854d0e, #713f12); border: 0; }
.pwa-card .pwa-x { flex-shrink: 0; width: 32px; height: 32px; margin: -4px -4px -4px 0; border-radius: 10px; border: 0; background: transparent;
  color: #854d0e; font-size: 16px; font-weight: 800; line-height: 1; opacity: .7; }
.pwa-card .pwa-x:hover, .pwa-card .pwa-x:focus-visible { background: #fef3c7; opacity: 1; }
.pwa-share { display: inline-flex; align-items: center; justify-content: center; vertical-align: -4px; width: 20px; height: 20px;
  border-radius: 6px; background: #eff6ff; color: #2563eb; margin: 0 1px; }
.pwa-share svg { width: 14px; height: 14px; }
.pwa-k { font-weight: 800; color: #713f12; white-space: nowrap; }

/* Toast ("new version ready · Refresh", "installed"): a card under the sticky header (top set by pwa.js), centred,
   full width on phones (12px margins), max 460px. Text takes the free width: one line from ~390px, two on 320px. */
.pwa-toast { position: fixed; top: 84px; left: 0; right: 0; margin: 0 auto; z-index: 9000; box-sizing: border-box;
  width: max-content; max-width: min(460px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 8px; border-radius: 18px; background: #713f12; color: #fff; border: 2px solid #a16207;
  font-family: 'Poppins', system-ui, sans-serif; font-weight: 600; font-size: 14px; line-height: 1.3;
  box-shadow: 0 12px 30px rgba(66, 32, 6, .35), 0 2px 0 rgba(255, 255, 255, .08) inset; animation: pwa-down .28s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pwa-down { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pwa-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pwa-toast-ico { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(250, 204, 21, .18); font-size: 18px; line-height: 1; }
.pwa-toast-msg { flex: 1 1 auto; min-width: 0; text-wrap: balance; padding-left: 2px; }
.pwa-toast:not(:has(.pwa-toast-ico)) .pwa-toast-msg { padding-left: 6px; }
.pwa-toast button { flex: 0 0 auto; border: 0; cursor: pointer; font-family: 'Fredoka', 'Poppins', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.pwa-toast .pwa-toast-go { min-height: 40px; padding: 0 16px; border-radius: 12px; background: #facc15; color: #713f12;
  font-size: 15px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 3px 0 #ca8a04; transition: transform .08s, box-shadow .08s, background .15s; }
.pwa-toast .pwa-toast-go:hover { background: #fde047; }
.pwa-toast .pwa-toast-go:active { transform: translateY(2px); box-shadow: 0 1px 0 #ca8a04; }
.pwa-toast .pwa-toast-x { width: 34px; height: 34px; border-radius: 50%; background: transparent; color: #fde68a; font-size: 14px; font-weight: 700; }
.pwa-toast .pwa-toast-x:hover { background: rgba(255, 255, 255, .1); }
.pwa-toast button:focus-visible { outline: 3px solid #fde047; outline-offset: 2px; }
@media (max-width: 360px) { .pwa-toast { gap: 6px; font-size: 13.5px; padding-left: 12px; } .pwa-toast .pwa-toast-go { padding: 0 12px; font-size: 14px; }
  .pwa-toast-ico { display: none; } .pwa-toast .pwa-toast-x { width: 30px; } }

/* Standalone (installed) polish: no rubber-band refresh gesture fighting the board */
html.pwa-standalone, html.pwa-standalone body { overscroll-behavior-y: none; }

/* v20: full-screen "Update Jumplin" card (server refused an old client) */
.jl-update { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, #7dd3fc 0%, #22d3ee 35%, #0e7490 100%); font-family: 'Fredoka', 'Poppins', system-ui, sans-serif; }
.jl-update-card { width: 100%; max-width: 420px; box-sizing: border-box; background: #fff; border-radius: 28px; padding: 28px 22px 22px; text-align: center;
  box-shadow: 0 18px 50px rgba(8, 47, 73, .35); animation: jlUpdPop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.jl-update-ico { position: relative; width: 96px; height: 96px; margin: 0 auto 10px; }
.jl-update-ico img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.jl-update-ico span { position: absolute; right: -12px; top: -12px; font-size: 34px; animation: jlUpdSpin 2.4s ease-in-out infinite; }
.jl-update-t { margin: 6px 0 6px; font-size: 32px; line-height: 1.1; font-weight: 700; color: #0e7490; }
.jl-update-s { margin: 0 0 18px; font-size: 17px; line-height: 1.4; color: #334155; }
.jl-update-go { display: block; width: 100%; min-height: 60px; border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-size: 22px; font-weight: 700;
  color: #fff; background: linear-gradient(180deg, #22c55e, #16a34a); box-shadow: 0 6px 0 #15803d, 0 10px 20px rgba(22,163,74,.35); }
.jl-update-go:active { transform: translateY(3px); box-shadow: 0 3px 0 #15803d; }
.jl-update-go:disabled { opacity: .75; cursor: progress; }
.jl-update-go:focus-visible { outline: 4px solid #facc15; outline-offset: 3px; }
.jl-update-f { margin: 12px 0 0; font-size: 14px; color: #64748b; }
body.mp-is-screen .jl-update-card { max-width: 720px; padding: 48px 40px 36px; }
body.mp-is-screen .jl-update-t { font-size: 56px; }
body.mp-is-screen .jl-update-s { font-size: 28px; }
body.mp-is-screen .jl-update-go { font-size: 36px; min-height: 92px; }
@keyframes jlUpdPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes jlUpdSpin { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(20deg) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .jl-update-card, .jl-update-ico span { animation: none; } }

/* v22: "This room has closed" card (room expired on the server) */
.jl-closed { position: fixed; inset: 0; z-index: 2147482900; display: flex; align-items: center; justify-content: center; padding: 20px;
  font-family: 'Fredoka', 'Poppins', system-ui, sans-serif; background: rgba(15, 23, 42, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.jl-closed-card { width: 100%; max-width: 420px; box-sizing: border-box; background: #fffbeb; border: 3px solid #854d0e; border-radius: 28px; padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.jl-closed-ico { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.jl-closed-t { margin: 4px 0 8px; font-size: 28px; line-height: 1.15; font-weight: 800; color: #713f12; }
.jl-closed-s { margin: 0 0 18px; font-size: 17px; line-height: 1.4; color: #334155; }
.jl-closed-go { display: block; width: 100%; min-height: 58px; border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-size: 21px; font-weight: 800;
  color: #fff; background: #854d0e; box-shadow: 0 5px 0 #713f12; }
.jl-closed-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #713f12; }
.jl-closed-go:focus-visible { outline: 4px solid #facc15; outline-offset: 3px; }
body.mp-is-screen .jl-closed-card { max-width: 720px; padding: 44px 40px 34px; }
body.mp-is-screen .jl-closed-t { font-size: 52px; }
body.mp-is-screen .jl-closed-s { font-size: 28px; }
body.mp-is-screen .jl-closed-go { font-size: 34px; min-height: 88px; }
