* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  color: #304434; background: #d6dfcf; font: 15px/1.6 "Microsoft YaHei", sans-serif;
}
#stage {
  position: fixed; inset: 0;
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
#world { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
@media (orientation: portrait) {
  #stage { inset: 0 auto auto 100%; width: 100vh; width: 100dvh; height: 100vw; transform: rotate(90deg); transform-origin: top left; }
}
button, input { font: inherit; }
button { border: 1px solid #c9d0c2; border-radius: 8px; padding: 9px 16px; color: inherit; background: #faf8ee; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid #dfaa53; outline-offset: 3px; }
dialog { width: min(450px, 92vw); max-height: calc(100dvh - 28px); overflow: auto; border: 1px solid #fff; border-radius: 20px; padding: 36px; color: #304434; background: #fbf9f0; box-shadow: 0 25px 100px #17302940; }
dialog::backdrop { background: #223d4033; backdrop-filter: blur(3px); }
dialog h1 { margin: 16px 0; font-size: 29px; }
dialog p { color: #6b7768; font-size: 14px; }
dialog label { display: block; margin: 25px 0 8px; font-size: 13px; }
dialog input { width: 100%; padding: 14px 10px; border: 1px solid #c8d0bf; border-radius: 8px; background: white; }
dialog small { display: block; color: #707a68; font-size: 11px; }
dialog a { display: inline-block; margin-top: 20px; color: inherit; font-size: 12px; }
.login-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; }
.login-links a { margin: 0; padding-block: 4px; }
.eyebrow { letter-spacing: 3px; font-size: 11px; color: #6c7c60; }
#stage[inert] { visibility: hidden; }
#game-loading h2 { margin: 0 0 18px; }
.loading-meter { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; }
.loading-meter progress { flex: 1; min-width: 0; height: 12px; accent-color: #305843; }
#loading-percent { min-width: 4ch; text-align: right; }
#customer-service .support-email { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
#google-signin { min-height: 44px; }
#login-error { min-height: 20px; margin: 8px 0; color: #9d4735; font-size: 12px; }
#login-retry { margin-right: 12px; }
.game-home { position: absolute; right: max(8px, var(--safe-right)); bottom: max(8px, var(--safe-bottom)); padding: 4px 9px; color: #304434; background: #fbf9f0e6; border-radius: 6px; font-size: 12px; text-decoration: none; }
.mini-dialog { border-radius: 14px; background: #f4f0e3; }
.mini-dialog h2 { font-size: 21px; margin-top: 0; }
.mini-dialog footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.mini-dialog button[value="ok"] { color: white; background: #305843; }
@media(max-width: 650px) { dialog { padding: 26px; } dialog h1 { font-size: 26px; } }
