:root { font-family: "Trebuchet MS", "Segoe UI", sans-serif; color: #294d45; background: #f5f1e5; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.game { height: 100vh; height: 100dvh; min-height: 360px; max-width: 1320px; margin: auto; padding: 12px 18px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; gap: 9px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.series { font-size: 12px; letter-spacing: .07em; margin: 0 0 2px; color: #687565; }
h1 { font-size: 28px; line-height: 1.1; margin: 0; }
.chapter { font-size: 14px; color: #687565; margin: 0; }
.message { position: relative; padding: 8px 14px; background: #fffaf0; border: 1px solid #dedac6; border-radius: 14px; min-height: 64px; display: flex; flex-direction: column; justify-content: center; }
.message p { margin: 0; line-height: 1.3; }
#instruction { font-size: 18px; font-weight: 700; }
#status { font-size: 16px; color: #5e6b51; }
.message:has(#word:not([hidden])) { padding-right: 154px; }
#word { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; }
#word [lang] { font-size: 26px; font-weight: 700; }
.scene { position: relative; min-height: 0; display: grid; grid-template-columns: 29% 71%; border-radius: 24px; background: #aac976 url('assets/r2/clearing.png') center/cover no-repeat; box-shadow: inset 0 0 0 1px #597b4544; }
.guide { position: relative; min-width: 0; min-height: 0; }
#girl { position: absolute; width: 91%; height: 77%; object-fit: contain; left: 0; top: 0; pointer-events: none; user-select: none; }
.map-wrap { position: absolute; width: 100%; aspect-ratio: 800/340; bottom: 6%; left: 0; }
#map { width: 100%; height: 100%; display: block; }
#first-point { position: absolute; left: 25.625%; top: 54.412%; transform: translate(-50%, -50%); width: 52px; height: 52px; padding: 0; border-radius: 50%; color: #5c6553; background: transparent; border: 2px dashed #8b896b; }
#first-point span { display: block; width: 26px; height: 26px; line-height: 26px; margin: auto; background: #f3e7bc; border-radius: 50%; font-size: 16px; }
#first-point[aria-disabled="true"] { cursor: default; }
[data-state="found"] #first-point { background: #f6fae8; border: 3px solid #497b59; box-shadow: 0 0 0 4px #f5f9ee; }
[data-state="success"] #first-point { border-color: #b77a19; background: #ffdf7966; }
[data-state="success"] #first-point span { background: #fff2a4; }
#arrived-star { position: absolute; width: 26%; left: 35%; top: -9%; pointer-events: none; }
.map-caption { position: absolute; bottom: 1%; width: 100%; margin: 0; text-align: center; color: #284330; font-size: 14px; text-shadow: 0 1px 3px #fffbed, 0 0 5px #fffbed; }
.hideouts { min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 4px 14px; padding: 12px 18px 14px 6px; }
button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; color: inherit; }
button:focus-visible { outline: 3px solid #285c83; outline-offset: 2px; }
.hideout { position: relative; min-width: 48px; min-height: 48px; padding: 0; border: 0; background: transparent; border-radius: 34%; display: flex; align-items: center; justify-content: center; }
.hideout:hover:not(.opened) { background: #ffffff16; }
.hideout > svg, #demo-leaf > svg { width: 100%; height: 100%; max-width: 240px; max-height: 180px; display: block; pointer-events: none; }
.finding-open-window { display: none; }
.opened .finding-peek-window { display: none; }
.opened .finding-open-window { display: initial; }
.hideout.hinted { background: #fff9c144; outline: 3px dashed #5d793e; outline-offset: -3px; }
.cover { transform-origin: 150px 115px; transition: transform .55s ease, opacity .55s ease; }
.opened .cover { transform: translate(42px, 15px) rotate(24deg) scale(.32); opacity: .7; }
.opened[data-cover="stone"] .cover { transform: translate(42px, 5px) rotate(12deg) scale(.32); }
.opened[data-cover="bush"] .cover { transform: translate(42px, 16px) rotate(-18deg) scale(.32); }
.finding { transform-origin: 100px 110px; }
.opened .finding { animation: hello .6s ease .12s 1; }
.departed .finding { visibility: hidden; }
@keyframes hello { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-7px) rotate(-5deg); } 75% { transform: rotate(3deg); } }
.controls { display: flex; justify-content: center; gap: 10px; }
.controls:has(#finish:not([hidden])) #again { background: #fffaf0; color: #294d45; border-color: #c2ccaf; }
.controls button, #start { min-height: 46px; padding: 9px 20px; border: 1px solid #c2ccaf; border-radius: 14px; font-size: 17px; font-weight: 700; background: #fffaf0; }
.controls .primary, #start { background: #35674f; color: #fffbed; border-color: #35674f; }
.controls button:disabled { color: #5b6f5d; background: #e2e9d9; cursor: default; }
#audio-note { margin: 0; font-size: 14px; color: #80522c; text-align: center; }
#load-message { position: absolute; inset: 30% 15% auto; text-align: center; background: #fffaf0; padding: 20px; border-radius: 16px; }
dialog { color: #294d45; background: #fffaf0; border: 1px solid #bdc7ab; border-radius: 24px; padding: 24px; width: min(720px, calc(100vw - 28px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 70px #203b4b40; }
dialog::backdrop { background: #203f3d88; }
.tutorial-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: #6b785a; font-size: 13px; }
h2 { font-size: 28px; margin: 0 0 12px; line-height: 1.1; }
#tutorial-text { font-size: 17px; line-height: 1.5; margin: 0; }
.demo { text-align: center; padding: 10px; background: #edf0d9; border-radius: 20px; }
#demo-leaf { display: flex; justify-content: center; background: transparent; border: 0; border-radius: 20px; width: 100%; height: 150px; padding: 0; }
#demo-caption { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.demo-steps { font-size: 13px; color: #5d6f4f; }
.demo-steps span { padding: 0 3px; }
#start { display: block; margin: 22px auto 0; min-width: 200px; }
.flying-star { position: fixed; z-index: 4; pointer-events: none; }
.completion { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #aac976 url('assets/r2/clearing.png') center/cover no-repeat; }
.completion-card { width: min(640px, 100%); padding: 28px; border: 1px solid #d9c99c; border-radius: 28px; background: #fffaf3f5; box-shadow: 0 20px 60px #26391b40; text-align: center; }
.completion-art { position: relative; width: 160px; margin: 12px auto; }
.completion-art img { display: block; width: 100%; height: auto; }
.completed-point { position: absolute; right: 0; bottom: 2px; display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #e3b240; border-radius: 50%; color: #735a24; font-size: 20px; background: #fff4ab; box-shadow: 0 0 16px #efb92980; }
.completion-message { max-width: 430px; margin: 14px auto; font-size: 18px; line-height: 1.4; }
.completion-word { margin: 12px 0 20px; font-size: 22px; }
.completion-word [lang] { font-size: 32px; font-weight: 700; }
.completion-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.completion-actions a, .completion-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid #becbad; border-radius: 14px; padding: 10px 20px; font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; color: #294d45; background: #fffaf0; }
.completion-actions .primary { background: #35674f; color: #fffbed; border-color: #35674f; }
.completion-actions a:focus-visible { outline: 3px solid #285c83; outline-offset: 3px; }
@media (max-width: 800px) {
  .game { padding: 8px 10px; gap: 6px; }
  h1 { font-size: 25px; }
  .scene { grid-template-columns: 26% 74%; }
  .hideouts { padding: 7px; gap: 2px; }
  .controls button { padding: 8px 12px; font-size: 16px; }
  #first-point { width: 48px; height: 48px; }
  .map-caption { font-size: 12px; }
  #instruction { font-size: 16px; }
  #status { font-size: 15px; }
}
@media (max-width: 520px) {
  .game { padding: 10px; gap: 8px; }
  header { justify-content: center; text-align: center; }
  .chapter { display: none; }
  .message { min-height: 104px; padding: 8px 10px; }
  .message:has(#word:not([hidden])) { padding-right: 10px; }
  #word { position: static; transform: none; font-size: 16px; }
  #word [lang] { font-size: 21px; }
  .scene { grid-template-columns: 1fr; grid-template-rows: 132px minmax(0, 1fr); border-radius: 20px; }
  #girl { width: 37%; height: 132px; top: 0; left: 1%; }
  .map-wrap { width: 62%; bottom: 12%; left: 36%; }
  .map-caption { width: 62%; left: 36%; bottom: 0; font-size: 13px; }
  .hideouts { padding: 0 6px 8px; gap: 2px 4px; }
  .controls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
  .controls button { min-height: 46px; font-size: 16px; padding: 8px; }
  .controls button { grid-column: span 2; }
  #again { grid-column: 1 / -1; }
  .controls:has(#finish:not([hidden])) #again, #finish { grid-column: span 3; }
  .completion { padding: 16px; }
  .completion-card { padding: 22px 18px; }
  .completion-actions { display: grid; }
  .tutorial-layout { grid-template-columns: 1fr; gap: 14px; }
  dialog { padding: 20px; }
  h2 { font-size: 25px; }
  #tutorial-text { font-size: 17px; line-height: 1.4; }
  #demo-leaf { height: 128px; }
  #start { margin-top: 16px; }
}
@media (max-width: 520px) and (max-height: 640px) {
  .scene { grid-template-columns: 30% 70%; grid-template-rows: minmax(0, 1fr); }
  #girl { width: 100%; height: 68%; left: 0; }
  .map-wrap { width: 100%; left: 0; bottom: 15%; }
  .map-caption { width: 100%; left: 0; bottom: 1%; font-size: 11px; line-height: 1.1; }
}
@media (max-height: 480px) {
  .game { padding: 6px 10px; gap: 5px; }
  h1 { font-size: 22px; }
  .series { font-size: 11px; }
  .message { padding: 5px 10px; min-height: 57px; }
  .message:has(#word:not([hidden])) { padding-right: 120px; }
  #word { right: 10px; font-size: 16px; }
  #word [lang] { font-size: 21px; }
  .map-caption { bottom: 0; font-size: 11px; }
  .hideouts { padding: 1px 8px; gap: 0; }
  .controls button { min-height: 44px; padding: 7px 11px; font-size: 16px; }
  dialog { padding: 16px; }
  h2 { font-size: 23px; }
  #tutorial-text { font-size: 16px; line-height: 1.35; }
  .eyebrow { margin-bottom: 6px; font-size: 12px; }
  #demo-leaf { height: 105px; }
  #start { margin-top: 12px; }
  .controls { gap: 6px; }
  .controls:has(#finish:not([hidden])) button { padding-inline: 9px; }
  .completion { padding: 12px; }
  .completion-card { max-width: 650px; padding: 16px 24px; }
  .completion-art { float: left; width: 135px; margin: 30px 18px 0 0; }
  .completion-card .series { margin-bottom: 14px; }
  .completion-message { margin-block: 10px; font-size: 17px; }
  .completion-word { margin: 8px 0 14px; }
  .completion-actions a, .completion-actions button { min-height: 44px; padding: 8px 13px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover { transition-duration: .01s; }
  .opened .finding { animation: none; }
}

