* { box-sizing: border-box; }
:root { color-scheme: light; color: #233c35; background: #eff3e6; font-family: system-ui, "Hiragino Sans", Meiryo, sans-serif; }
body { margin: 0; }
[hidden] { display: none !important; }
main {
  width: min(100%, 503px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) max(7px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  flex-direction: column;
}
header { width: 100%; min-height: 59px; align-items: center; justify-content: space-between; display: flex; gap: 8px; padding: 3px 6px; }
header a { color: #364b41; text-decoration: none; white-space: nowrap; font-size: 13px; display: flex; align-items: center; min-height: 44px; }
h1 { text-align: right; line-height: 1.18; margin: 0; font-size: clamp(16px, 4.5vw, 23px); font-weight: 850; letter-spacing: -.04em; }
.board { position: relative; flex: none; width: min(100%, calc((100vh - 66px) * 320 / 490)); width: min(100%, calc((100svh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 320 / 490)); aspect-ratio: 320 / 490; }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 22px; background: #a6d9d5; box-shadow: 0 4px 9px #304e4025; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.board[data-phase="ready"] canvas { cursor: crosshair; }
#hint { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); padding: 10px 16px; border-radius: 22px; margin: 0; background: #fdf8d8; box-shadow: 0 3px 0 #428a8790; color: #233d36; white-space: nowrap; font-size: clamp(13px, 4vw, 16px); font-weight: 780; pointer-events: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; cursor: pointer; border: 0; border-radius: 13px; padding: 7px 11px; font: inherit; font-weight: 750; color: #1d4032; background: #f8f2d0; }
:focus-visible { outline: 3px solid #175739; outline-offset: 2px; }
#score { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); color: #1d443b; background: #fff7dc; box-shadow: 0 3px 0 #48858399; border-radius: 13px; padding: 0.06em .39em .1em; font-weight: 900; font-size: clamp(22px, 7.8vw, 39px); white-space: nowrap; font-variant-numeric: tabular-nums; }
#score span { font-size: .55em; margin-inline-start: .2em; }
.return, .share { position: absolute; bottom: 3.7%; width: 43%; white-space: nowrap; font-size: clamp(12px, 3.8vw, 16px); box-shadow: 0 3px 0 #25534f67; }
.return { left: 6%; color: #f9f9e7; background: #256451; }
.share { right: 6%; background: #fbf5db; }
.copy { position: absolute; inset: auto 6% 17%; display: grid; gap: 4px; border-radius: 10px; background: #f8f2d0; padding: 6px; }
.copy textarea { padding: 6px; font: 16px system-ui; min-height: 65px; width: 100%; }
.notice { position: absolute; inset: auto 12% 40%; margin: auto; padding: 8px; border-radius: 8px; text-align: center; background: #1c5143; color: #fff; pointer-events: none; }
@media (orientation: landscape) and (max-height: 540px) {
  main { width: min(100%, 560px); min-height: auto; }
  header { min-height: 45px; }
  h1 { font-size: 14px; }
  #score { bottom: 24%; font-size: 23px; }
  .board { width: min(100%, calc((100svh - 51px) * 320 / 490)); }
  .return, .share { padding-inline: 3px; }
}
