/* ============================================================
   Zen Cream UI theme — 解压奶油风 🍦
   (layout rules preserved from the original template)
   ============================================================ */
:root {
  --bg-top: #fdf6ec;
  --bg-mid: #f8efe5;
  --bg-bot: #f3e9e1;
  --fg: #8a7462;
  --dim: #b5a290;
  --accent: #e0938a;
  --accent-2: #a99ad0;
  --card: rgba(255, 255, 255, 0.75);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--fg);
  font-family: "Baloo 2", "Yuanti SC", "幼圆", "YouYuan", "Comic Sans MS", "Trebuchet MS", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-bot) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  overflow: hidden;
}

/* ---- decorations layer: muted for a calm look ---- */
.kawaii {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.kawaii .kw { display: none; }

/* one soft static blob, very faint */
.kawaii::before, .kawaii::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  width: 46vmin;
  height: 46vmin;
  filter: blur(70px);
  opacity: .16;
}

.kawaii::before {
  background: #f3cfae;
  top: -12vmin;
  left: -10vmin;
}

.kawaii::after {
  background: #cfc4ec;
  bottom: -14vmin;
  right: -10vmin;
}

.bar, #game, .hint, footer { position: relative; z-index: 1; }

.bar {
  width: 100%;
  max-width: 460px;
  flex: 0 0 auto;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: .1em;
  font-weight: 800;
  color: #c08268;
  text-shadow: 0 1px 0 #fff;
  animation: bob 3.6s ease-in-out infinite;
}

h1 .kw-emoji {
  display: inline-block;
  margin-right: 6px;
  animation: none;
}

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.tag {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--dim);
}

/* ---- game viewport: portrait 9:16 ---- */
#game {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: min(460px, calc((100vh - 150px) * 0.5625));
  aspect-ratio: 720 / 1280;
  max-height: calc(100vh - 150px);
  /* dvh: on mobile browsers vh includes the collapsing URL bar, so the stage
     overflowed and its bottom (HUD, CONTINUE button) fell off screen */
  max-width: min(460px, calc((100dvh - 150px) * 0.5625));
  max-height: calc(100dvh - 150px);
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: #fbf3e9;
  border: 5px solid #fff;
  box-shadow:
    0 14px 34px rgba(190, 160, 130, .22),
    0 0 0 8px rgba(255, 255, 255, .35);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game canvas {
  display: block;
  border-radius: 23px;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
  flex: 0 0 auto;
}

.hint span {
  background: var(--card);
  border-radius: 999px;
  padding: 3px 10px;
  margin: 0 3px;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(190, 160, 130, .16);
}

kbd {
  background: #fff;
  border: 2px solid #eadfd2;
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 1px 7px;
  font-family: inherit;
  font-size: 12px;
  color: #b07a5e;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

nav a {
  color: #8a6f5c;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: var(--card);
  border-radius: 999px;
  padding: 5px 13px;
  box-shadow: 0 3px 8px rgba(190, 160, 130, .16);
  transition: transform .15s, box-shadow .15s, color .15s;
}

nav a:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 14px rgba(190, 160, 130, .3);
  color: #c08268;
}

/* ---- ad slots (uncomment markup in index.html to activate) ---- */
.ad {
  min-height: 50px;
  margin: 6px 0;
}

@media (min-height: 900px) {
  .ad { min-height: 90px; }
}

/* ============================================================
   Static content pages (privacy / terms) — these scroll
   ============================================================ */
body.doc {
  overflow: auto;
  padding: 26px 18px 46px;
  gap: 6px;
}

body.doc h1 a {
  color: #c08268;
  text-decoration: none;
  text-shadow: none;
}

body.doc h1 a:hover { color: #a96f57; }

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
}

.page h2 {
  margin: 10px 0 2px;
  font-size: 26px;
  color: #c08268;
  letter-spacing: .01em;
}

.page h3 {
  margin: 30px 0 6px;
  font-size: 17px;
  color: #97836b;
}

.page p, .page li { color: #8d7b6c; }

.page ul { padding-left: 22px; margin: 8px 0; }
.page li { margin: 4px 0; }

.page a { color: var(--accent); text-decoration: none; }
.page a:hover { text-decoration: underline; }

.page code {
  background: #f7ece0;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
  color: #b56a4e;
}

.updated {
  margin-top: 0;
  color: #b8a694 !important;
  font-size: 13px;
}

.back { margin-top: 38px; }
