/* Web play window (/webplay/game, 2026-10-28). The game sits in the window of the owner's artwork frame
   (art/webplay/frame.webp 1672x941 = 16:9; window x 374-1297, y 152-755 -> the % below, ratio 1.53; the gem that reached
   into it was cut off; source + script design/webplay/make_frame.py),
   so its ratio never changes. Buttons sit on the bottom strip of the art; their size follows the frame width (cqw).
   html[data-mode=full] drops the frame and fills the browser. */
:root{
  --pad:14px;
  --fr:1.77683;        /* frame width / height */
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{font-family:'Noto Sans Thai',system-ui,sans-serif;background:#0b1024;color:#fff;-webkit-font-smoothing:antialiased}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
a{color:inherit;text-decoration:none}
svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;flex:none}
button:focus-visible,a:focus-visible{outline:2px solid #ffd77a;outline-offset:2px}

/* backdrop = the same artwork, blurred and darkened, so the sides blend into the frame */
.wp-bg{position:fixed;inset:-30px;background:url(../art/webplay/frame_bg.jpg?v=3) 50% 50%/cover no-repeat;filter:blur(16px) saturate(1.15) brightness(.5)}
.wp-bg::after{content:"";position:absolute;inset:0;background:radial-gradient(70% 75% at 50% 50%,rgba(11,16,36,0) 45%,rgba(11,16,36,.8) 100%)}

.wp-stage{position:relative;z-index:1;height:100%;display:grid;place-items:center;padding:var(--pad)}
/* no filter / shadow on .wp-art: it would re-filter the game iframe every frame */
.wp-art{position:relative;container-type:inline-size;aspect-ratio:1672/941;width:min(100vw - var(--pad)*2, (100vh - var(--pad)*2) * var(--fr))}
@supports (height:100dvh){.wp-art{width:min(100vw - var(--pad)*2, (100dvh - var(--pad)*2) * var(--fr))}}
.wp-screen{position:absolute;left:22.368%;top:16.153%;width:55.263%;height:64.187%;background:#000}
.wp-screen iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#000}
.wp-frame{position:absolute;inset:0;width:100%;height:100%;max-width:none;pointer-events:none;user-select:none;z-index:2;
  /* soften the picture's outer edge into the blurred backdrop */
  -webkit-mask:linear-gradient(90deg,transparent,#000 2.5%,#000 97.5%,transparent),linear-gradient(transparent,#000 2.5%,#000 97.5%,transparent);
  -webkit-mask-composite:source-in;mask:linear-gradient(90deg,transparent,#000 2.5%,#000 97.5%,transparent),linear-gradient(transparent,#000 2.5%,#000 97.5%,transparent);mask-composite:intersect}
.wp-btns{position:absolute;z-index:3;left:50%;top:83%;transform:translateX(-50%);display:flex;gap:.9cqw}
.wp-btn{display:inline-flex;align-items:center;justify-content:center;gap:.45cqw;min-width:9.6cqw;height:3.2cqw;padding:0 1.1cqw;border-radius:.75cqw;
  font:700 1.12cqw/1 'Noto Sans Thai',system-ui,sans-serif;color:#fff;white-space:nowrap;text-shadow:0 .1cqw .2cqw rgba(0,0,0,.45);
  border:.18cqw solid #f6d47c;box-shadow:0 .35cqw 0 rgba(60,32,6,.65),0 .6cqw 1.4cqw rgba(0,0,0,.4),inset 0 .15cqw 0 rgba(255,255,255,.45);
  transition:transform .12s,box-shadow .12s,filter .12s}
.wp-btn svg{width:1.3cqw;height:1.3cqw;stroke-width:2.4}
.wp-btn:hover{filter:brightness(1.1);transform:translateY(-.15cqw)}
.wp-btn:active{transform:translateY(.3cqw);box-shadow:0 .05cqw 0 rgba(60,32,6,.65),0 .3cqw .8cqw rgba(0,0,0,.4),inset 0 .15cqw 0 rgba(255,255,255,.45)}
.wp-reg{background:linear-gradient(#ff8fb6,#e2507f 55%,#b8325f)}
.wp-don{background:linear-gradient(#ffd56a,#f0a22a 55%,#c4741a)}
.wp-full{background:linear-gradient(#7fa3f2,#4a6fd6 55%,#2f4aa8)}
.wp-now{background:linear-gradient(#7ee08f,#33b45a 55%,#1f7d3c)}

/* full: no frame, the game fills the browser window */
.wp-restore{display:none}
html[data-mode="full"] .wp-bg,html[data-mode="full"] .wp-frame,html[data-mode="full"] .wp-btns{display:none}
html[data-mode="full"] .wp-stage{padding:0}
html[data-mode="full"] .wp-art{position:fixed;inset:0;width:auto;aspect-ratio:auto}
html[data-mode="full"] .wp-screen{inset:0;width:auto;height:auto}
html[data-mode="full"] .wp-restore{display:inline-flex;position:fixed;z-index:5;top:0;left:50%;transform:translateX(-50%);align-items:center;gap:5px;
  height:22px;padding:0 12px;border-radius:0 0 9px 9px;font-size:12px;font-weight:700;color:#fff;background:rgba(27,40,86,.55);
  border:1px solid rgba(158,182,228,.6);border-top:0;opacity:.75;transition:opacity .15s;box-shadow:0 2px 8px rgba(0,0,0,.35)}
html[data-mode="full"] .wp-restore:hover,html[data-mode="full"] .wp-restore:focus-visible{opacity:1;background:#3f5bb2}
.wp-restore svg{width:13px;height:13px}

