/* Page-level chrome only — everything inside the canvas is drawn by
   wechat-minigame/js/app.js and untouched by this file. This just centers
   a max-width "phone" column so the game reads naturally on a wide desktop
   browser instead of stretching a mobile-first layout edge to edge. */

:root {
  color-scheme: light;
  --page-background: #17231d;
}

* {
  box-sizing: border-box;
}

/* Standard "visually hidden but present" technique — keeps index.html's
   real-content block (game list/description, for search engines and screen
   readers, since the canvas itself has no readable text) out of sighted
   layout without display:none/visibility:hidden, which would hide it from
   crawlers and assistive tech too, not just visually. */
.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;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--page-background);
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

#game-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: #dfc9a7;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

#game-canvas {
  display: block;
  /* Pointer gestures (menu swipe, drag-to-scroll) are handled entirely by
     wechat-minigame/js/app.js's own touch logic — disabling the browser's
     native pan/zoom/scroll on the canvas stops it from fighting those. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  /* A single <canvas> has no native tappable sub-elements, but mobile
     Safari/Chrome still paint their default tap-highlight flash and
     long-press callout (image-save/copy menu) on it as if it were one —
     both look like a rendering glitch on a canvas game. */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* src/main.js sets this class on <body> while the pointer is hovering a
   clickable region (button/game-list row/etc., hit-tested against the
   running MiniGameApp's own app.buttons) — desktop-only affordance; touch
   input never triggers hover in the first place. */
body.is-hovering-clickable #game-canvas {
  cursor: pointer;
}

.wx-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 35, 29, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.wx-share-card {
  background: #fbfcfb;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.wx-share-label {
  margin: 0 0 12px;
  font-size: 14px;
  color: #4e615b;
}

.wx-share-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5dfda;
  margin-bottom: 14px;
  color: #20312b;
  background: #f0f5f2;
}

.wx-share-close {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #347c68;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.wx-toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  transform: translate(-50%, 12px);
  background: rgba(32, 49, 43, 0.92);
  color: #fbfcfb;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  max-width: 80%;
  text-align: center;
}

.wx-toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
