*{box-sizing:border-box}
:root{color-scheme:dark;font-family:"Segoe UI",Inter,"Microsoft YaHei","Helvetica Neue","PingFang SC","Noto Sans","Noto Sans CJK SC",Arial,sans-serif}
html,body{width:100%;min-height:100%;margin:0}
body.game-page{
  --card-accent-rgb:167,157,137;
  --game-aspect-ratio:16 / 9;
  display:grid;
  min-height:100dvh;
  place-items:center;
  padding:16px;
  overflow:auto;
  background:#0a0a0b;
  color:#f7f4ed;
  touch-action:auto;
}
body.game-page::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  background-image:
    linear-gradient(180deg,rgba(5,17,20,.2),rgba(8,11,12,.52) 52%,rgba(10,10,11,.82)),
    linear-gradient(180deg,rgba(18,105,119,.24),rgba(15,69,77,.14) 42%,rgba(12,52,60,.1)),
    url("../assets/ui/background.jpg");
  background-position:center;
  background-size:cover,cover,auto 145%;
  background-repeat:no-repeat;
  opacity:.64;
  filter:grayscale(1) contrast(.96) brightness(.84);
  pointer-events:none;
}
.game-page-stage{
  position:relative;
  z-index:1;
  width:min(calc(100vw - 32px),calc((100dvh - 122px) * 16 / 9 + 28px),988px);
}
body[data-aspect="4:3"]{
  --game-aspect-ratio:4 / 3;
}
body[data-aspect="4:3"] .game-page-stage{
  width:min(calc(100vw - 32px),calc((100dvh - 122px) * 4 / 3 + 28px),988px);
}
.game-page-panel{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  width:100%;
  overflow:hidden;
  border:2px solid #fff;
  border-radius:16px;
  background-color:#17110d;
  background-image:
    radial-gradient(ellipse at 50% -12%,rgba(150,104,57,.28),transparent 48%),
    linear-gradient(135deg,rgba(255,224,174,.045),transparent 36%,rgba(0,0,0,.18)),
    repeating-linear-gradient(112deg,rgba(255,232,199,.018) 0 1px,transparent 1px 4px),
    repeating-linear-gradient(22deg,rgba(0,0,0,.055) 0 1px,transparent 1px 5px);
  box-shadow:0 40px 110px rgba(0,0,0,.72),inset 0 1px 0 rgba(255,230,196,.12),inset 0 -2px 0 rgba(0,0,0,.72);
}
.game-page-panel::before{
  content:"";
  position:absolute;
  inset:7px;
  z-index:3;
  border:1px solid rgba(220,178,127,.13);
  border-radius:9px;
  pointer-events:none;
}
.game-page-toolbar{
  position:relative;
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:38px;
  margin:12px 12px 6px;
  padding:5px 6px 5px 12px;
  border-radius:4px 8px 8px 4px;
  background:linear-gradient(90deg,rgba(var(--card-accent-rgb),.56),rgba(var(--card-accent-rgb),.9) 50%,rgba(var(--card-accent-rgb),.56));
  box-shadow:0 1px 4px rgba(0,0,0,.34);
}
.game-page-title{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  color:#282219;
  font-size:.88rem;
  font-weight:700;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.game-page-escape{margin:0 10px;color:#fff;font-size:.57rem;font-weight:700;letter-spacing:.08em}
.game-page-actions{display:flex;align-items:center;gap:6px}
.game-page-actions button,.game-page-close{
  display:flex;
  width:32px;
  height:28px;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  background:transparent;
  color:#fff;
  cursor:pointer;
}
.game-page-actions button:focus-visible,.game-page-close:focus-visible{outline:2px solid #fff;outline-offset:2px}
.game-page-fullscreen-icon{
  width:14px;
  height:14px;
  background:
    linear-gradient(currentColor,currentColor) left top / 5px 1px no-repeat,
    linear-gradient(currentColor,currentColor) left top / 1px 5px no-repeat,
    linear-gradient(currentColor,currentColor) right top / 5px 1px no-repeat,
    linear-gradient(currentColor,currentColor) right top / 1px 5px no-repeat,
    linear-gradient(currentColor,currentColor) left bottom / 5px 1px no-repeat,
    linear-gradient(currentColor,currentColor) left bottom / 1px 5px no-repeat,
    linear-gradient(currentColor,currentColor) right bottom / 5px 1px no-repeat,
    linear-gradient(currentColor,currentColor) right bottom / 1px 5px no-repeat;
}
.game-page-close{text-decoration:none}
.game-page-close-icon,.game-page-close-icon::after{display:block;width:13px;height:1px;background:currentColor;transform:rotate(45deg)}
.game-page-close-icon::after{content:"";transform:rotate(90deg)}
.game-page-frame{
  position:relative;
  z-index:2;
  width:auto;
  margin:0 12px 12px;
  overflow:hidden;
  aspect-ratio:var(--game-aspect-ratio);
  border-radius:2px;
  background:#000;
  box-shadow:0 1px 0 rgba(255,230,196,.08),0 8px 24px rgba(0,0,0,.34);
  touch-action:none;
}
.game-page-frame>#canvas,.game-page-frame>#game-container{
  position:absolute!important;
  inset:0;
  display:block;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0;
}
.game-page-frame>#game-container>canvas{display:block;max-width:100%;max-height:100%}
.game-page-frame>#status{position:absolute;inset:0}
.game-device-unsupported .game-page-frame{
  display:grid;
  min-height:clamp(220px,55vw,360px);
  place-items:center;
  aspect-ratio:auto;
}
.game-device-unsupported .game-page-frame>#canvas,
.game-device-unsupported .game-page-frame>#game-container,
.game-device-unsupported .game-page-frame>#status,
.game-device-unsupported .game-page-fullscreen,
.game-device-unsupported .game-page-escape{display:none!important}
.game-device-notice{
  position:relative;
  z-index:11;
  padding:24px;
  color:#f7f4ed;
  text-align:center;
  line-height:1.5;
}
.game-device-notice strong{font-size:clamp(1rem,3vw,1.3rem)}
.game-device-notice p{margin:10px 0 0;color:#b9b6b0;font-size:.9rem}
.game-page-footer{position:relative;z-index:2;display:flex;padding:18px 2px 0}
.game-page-wavedash{display:inline-flex;align-items:baseline;gap:.5em;color:#fff;font-size:clamp(.92rem,1.25vw,1.08rem);font-weight:700;text-decoration:none}
.game-page-wavedash>span:first-child{text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:4px}
.game-page-wavedash[hidden]{display:none}
.game-page-wavedash-arrow{font-size:1.08em}
.game-page-panel:fullscreen{width:100vw;height:100vh;border:0;border-radius:0}
.game-page-panel:fullscreen .game-page-toolbar{margin:8px 8px 6px}
.game-page-panel:fullscreen .game-page-frame{flex:1;min-height:0;margin:0;aspect-ratio:auto;border-radius:0}
@media(max-width:640px){
  body.game-page{padding:8px}
  .game-page-stage{width:100%}
  .game-page-escape{display:none}
  .game-page-toolbar{margin:8px 8px 5px}
  .game-page-frame{margin:0 8px 8px}
}
