* { box-sizing: border-box; }
:root { color-scheme: light; background: #e9f1f6; color: #24364a; font-family: system-ui, "Hiragino Sans", Meiryo, sans-serif; }
body { margin: 0; }
[hidden] { display: none !important; }
main { display: grid; justify-items: center; width: min(100%, 490px); margin: 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)); }
header { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 7px; }
header a { min-height: 44px; display: inline-flex; align-items: center; flex: none; font-size: 12px; color: inherit; text-decoration: none; }
h1 { margin: 0; font-size: clamp(14px, 4.2vw, 20px); text-align: right; }
#board { width: min(100%, calc((100vh - 56px) * 320 / 490)); width: min(100%, calc((100svh - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 320 / 490)); position: relative; aspect-ratio: 320 / 490; overflow: hidden; border-radius: 19px; background: #88bfd0; box-shadow: 0 5px 16px #4b687630; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#status { position: absolute; top: 3.5%; left: 4%; right: 4%; text-align: center; pointer-events: none; }
#status p { display: inline-block; margin: 0; border-radius: 100px; padding: 5px 11px; background: #f7fcffe8; font-size: clamp(12px, 3.9vw, 16px); font-weight: 750; font-variant-numeric: tabular-nums; }
#control { position: absolute; z-index: 1; left: 0; right: 0; top: 82.04%; bottom: 0; border: 0; background: transparent; color: transparent; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#control:active { cursor: grabbing; }
#resume { position: absolute; z-index: 2; left: 50%; top: 67%; transform: translateX(-50%); }
#result { position: absolute; z-index: 2; bottom: 1.5%; inset-inline: 6%; display: grid; justify-items: center; gap: 3px; padding: 4px 7px; border-radius: 13px; background: #f7fcff; box-shadow: 0 4px 16px #375f7340; text-align: center; }
.result-line { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
#score { font-size: clamp(18px, 5.2vw, 27px); line-height: 1.05; white-space: nowrap; }
#detail { font-size: clamp(10px, 3.1vw, 14px); }
.actions { display: flex; gap: 6px; justify-content: center; width: 100%; }
button:not(#control) { min-height: 44px; padding: 5px 10px; border-radius: 8px; border: 1px solid #9dbacb; color: #254258; background: #e6f1f7; font: 750 clamp(12px, 3.7vw, 16px) system-ui, sans-serif; white-space: nowrap; }
#again:not(#control), #resume:not(#control) { color: #fff; background: #254258; }
#share-options { position: absolute; bottom: calc(100% + 5px); inset-inline: 0; padding: 6px; border-radius: 10px; background: #f7fcff; box-shadow: 0 4px 16px #375f7340; }
#copy { display: block; width: 100%; resize: none; font-size: 16px; }
#image, #notice { font-size: 12px; color: #254258; }
#image { display: inline-flex; min-height: 33px; align-items: center; margin-right: 5px; }
:focus-visible { outline: 3px solid #2c5c7c; outline-offset: -3px; }
@media (orientation: landscape) and (max-height: 460px) {
  #result { inset-inline: 2%; padding: 3px; }
  button:not(#control) { min-height: 33px; padding-inline: 3px; }
  #score { font-size: 17px; }
}
