:root {
  color-scheme: light;
  font: 15px/1.5 system-ui,-apple-system,'PingFang SC','Microsoft Yahei',sans-serif;
  background: #f3f0e7;
  color: #333a33;
  --muted: #626b5e;
  --line: #b1b2a35c;
  --accent: #57684c;
}
* { box-sizing: border-box; }
body { margin: 0; }
.game-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.game-header {
  position: absolute;
  z-index: 2;
  top: max(15px,env(safe-area-inset-top));
  inset-inline: max(17px,env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
.title-inscription {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-top: 5px;
  mix-blend-mode: multiply;
}
.title-inscription h1 { margin: 0; }
.wordmark { display: block; width: 49px; height: auto; }
.author-seal { display: block; width: 22px; height: auto; margin-bottom: 5px; }
.season-stamps {
  display: grid;
  grid-template-columns: repeat(2,29px);
  gap: 2px;
  margin: 16px 0 0 3px;
  pointer-events: auto;
}
.season-stamps button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.season-stamps img {
  display: block;
  background: #985247;
  border-radius: 2px 1px 2px 1px;
  transition: background-color .15s ease;
}
.season-stamps button:hover img { background: #8d463b; }
.season-stamps button[aria-pressed="true"] img {
  background: #78352d;
  box-shadow: inset 0 0 0 1px #f7dfbb9c;
}
.corner-tools {
  position: fixed;
  top: max(20px,env(safe-area-inset-top));
  right: max(24px,env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.corner-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #3e5142;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.corner-button:disabled { opacity: .48; cursor: default; }
.music-note { display: grid; place-items: center; flex: 0 0 15px; height: 15px; font-size: 17px; line-height: 15px; }
.language-control { position: relative; }
.language-control summary { list-style: none; }
.language-control summary::-webkit-details-marker { display: none; }
.globe-symbol {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.globe-symbol::before, .globe-symbol::after { content: ""; position: absolute; }
.globe-symbol::before {
  inset: -1px 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.globe-symbol::after { inset: 50% 0 auto; border-top: 1px solid currentColor; }
.language-chevron {
  width: 6px;
  height: 6px;
  margin: -3px 2px 0;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.language-control[open] .language-chevron { transform: translateY(3px) rotate(225deg); }
.language-options {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 143px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6f3e9;
  box-shadow: 0 5px 17px #3e51421d;
}
.language-options button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 32px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.language-options button:hover,
.language-options button[aria-pressed="true"] { background: #e1e7d8; }
.language-options button[aria-pressed="true"]::after {
  content: "";
  width: 4px;
  height: 8px;
  margin: -3px 2px 0;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.walk-mode {
  position: absolute;
  z-index: 2;
  bottom: max(14px,env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: calc(100% - 18px);
  padding: 2px 4px;
  white-space: nowrap;
}
.walk-mode button {
  position: relative;
  min-height: 37px;
  padding: 3px 14px 5px;
  color: #3f5545;
  background: radial-gradient(ellipse at 48% 51%,#f7f2e7df 12%,#f7f2e7ad 48%,#f7f2e700 76%);
  text-shadow: 0 0 3px #f7f2e7;
  border: 0;
  border-radius: 5px 8px 4px 6px;
  font: inherit;
  cursor: pointer;
}
.walk-mode:lang(zh) button {
  font-family: 'Kaiti SC',STKaiti,KaiTi,'Songti SC','Noto Serif CJK SC',serif;
  font-size: 16px;
}
.walk-mode button:hover { color: #263b2c; }
.walk-mode button[aria-pressed="true"] {
  background: radial-gradient(ellipse at 42% 52%,#d2ddc8ee 4%,#dfe6d4bd 48%,#dfe6d400 74%);
  color: #263b2c;
}
.walk-mode button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 21%;
  bottom: 6px;
  height: 3px;
  background: linear-gradient(90deg,#62785838,#5c745ad4 29%,#607658aa 68%,#667b6100);
  clip-path: polygon(0 65%,12% 32%,39% 24%,65% 38%,84% 5%,100% 33%,86% 66%,52% 71%,23% 67%,7% 100%);
  pointer-events: none;
}
:where(.corner-button,.season-stamps button,.language-options button,.walk-mode button,.gallery-back,.logo-option,#map):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.play {
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #c8dfe0;
  isolation: isolate;
}
#map { position: relative; display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: crosshair; }
.play::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--paper-texture);
  pointer-events: none;
}
.play[data-season="winter"]::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -330px -90px 0;
  background-image: var(--snow-texture);
  pointer-events: none;
  animation: falling-snow 6.8s linear infinite;
}
@keyframes falling-snow {
  to { transform: translateY(320px); }
}
@media (prefers-reduced-motion: reduce) {
  .play[data-season="winter"]::before { animation: none; }
}
#map:focus-visible { outline-offset: -2px; }
#minimap {
  position: absolute; z-index: 3; bottom: max(14px,env(safe-area-inset-bottom)); right: 15px;
  width: 172px; height: auto; border: 1px solid #8c917591;
  border-radius: 7px; background: #eeebdf; pointer-events: none;
}
@media (max-width: 720px) {
  .game-header { top: max(10px,env(safe-area-inset-top)); inset-inline: 9px; gap: 7px; }
  .author-seal { width: 17px; margin-bottom: 3px; }
  .wordmark { width: 37px; }
  .walk-mode { padding: 2px 3px; }
  .walk-mode button { padding-inline: 9px; }
  #minimap { width: 116px; right: 9px; bottom: max(61px,calc(env(safe-area-inset-bottom) + 46px)); }
}
.logo-page { min-height: 100dvh; background: #f3f0e7; }
.logo-gallery { width: min(940px,calc(100% - 36px)); margin: 0 auto; padding: clamp(22px,5vw,58px) 0; }
.gallery-back { color: #4d674d; text-underline-offset: .2em; }
.logo-gallery h1 { margin: 21px 0 4px; font-size: clamp(25px,4vw,34px); }
.logo-gallery p { margin: 0 0 21px; color: var(--muted); }
.logo-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,128px),1fr)); gap: clamp(8px,2vw,20px); }
.logo-option {
  display: block; min-width: 0; text-decoration: none; color: inherit; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: #f9f6ec;
}
.logo-option > img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.logo-option div { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 10px 13px; }
.logo-option:hover { border-color: #6d8068; }
.logo-option strong { font-size: clamp(12px,2vw,15px); }
.icon-sample { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 3px; }
@media (max-width: 440px) {
  .logo-option div { padding: 7px 5px; }
  .icon-sample { width: 16px; height: 16px; }
}

@media (max-width: 680px) {
  .corner-tools { top: max(12px,env(safe-area-inset-top)); right: max(16px,env(safe-area-inset-right)); }
}
