:root { color-scheme: light; font: 13px/1.45 "Trebuchet MS",Arial,sans-serif; color: #293c32; background: #88cce7; background-image: radial-gradient(ellipse at 20% 0,#d7f2ef,transparent 65%),linear-gradient(#88cce7 0 65%,#91b953 65%); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; padding: 20px max(12px,env(safe-area-inset-left)); }
.site-shell { max-width: 1040px; margin: auto; padding: 0 12px 8px; overflow: hidden; background: #fff1bc; border: 3px solid #303e2b; border-radius: 24px 18px 26px 16px; box-shadow: 5px 7px 0 #303e2b,0 18px 35px #23413130; }
header { margin: 0 -12px; padding: 15px 20px; background: #3c794b; color: #ffe568; border-bottom: 4px solid #303e2b; box-shadow: inset 0 -4px 0 #285d39; }
h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 28px; font-style: italic; font-weight: 900; letter-spacing: -1px; text-shadow: 2px 3px 0 #253d2b; }
h1 span { margin-left: auto; padding: 3px 10px; border: 2px solid #293e2c; border-radius: 9px 13px 8px 12px; background: #ffda5f; transform: rotate(4deg); text-shadow: none; font-style: normal; font-size: 12px; font-weight: bold; letter-spacing: 1px; color: #344332; }
.baseball { position: relative; flex: 0 0 34px; width: 34px; height: 34px; border: 2px solid #283b2d; box-shadow: 1px 2px 0 #263b2d; overflow: hidden; border-radius: 50%; background: #fff9e9; transform: rotate(-25deg); }
.baseball::before,.baseball::after { content: ""; position: absolute; top: -3px; width: 22px; height: 35px; border: 2px dashed #c7493a; border-radius: 50%; }
.baseball::before { left: -14px; }
.baseball::after { right: -14px; }
nav { display: flex; flex-wrap: wrap; gap: 9px; padding: 12px 2px 15px; }
button,.home-link { min-height: 38px; padding: 8px 13px; border: 2px solid #303e2b; border-radius: 12px 9px 14px 8px; background: #ffda5f; color: #293c32; font: inherit; font-weight: 900; cursor: pointer; box-shadow: 2px 4px 0 #303e2b,inset 0 2px 0 #ffffff70; }
.home-link { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none; }
button:hover:not(:disabled),.home-link:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active:not(:disabled),.home-link:active { transform: translate(1px,3px); box-shadow: 1px 1px 0 #303e2b; }
button:disabled { color: #6d7051; background: #e7dfb0; box-shadow: 1px 2px 0 #8c906a; border-color: #8c906a; cursor: default; }
button:focus-visible,input:focus-visible,a:focus-visible { outline: 3px solid #d46632; outline-offset: 3px; }
#restore { background: #b3d878; }
#escape { background: #ffc184; }
#backup { background: #b8dfe7; }
#fullscreen { margin-left: auto; background: #bcd9ed; }
nav button:disabled { background: #e7dfb0; }
main { display: grid; place-items: center; padding: 5px; overflow: hidden; border: 3px solid #303e2b; border-radius: 15px 11px 17px 10px; background: #39694b; box-shadow: 2px 3px 0 #bd9a4f; }
#stage { position: relative; width: min(100%,calc((100dvh - 280px)*4/3)); aspect-ratio: 4/3; background: #111c24; }
canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; touch-action: none; outline: none; }
#welcome { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; overflow: hidden; isolation: isolate; background: #41835a; }
.field-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#start { display: flex; align-items: center; gap: 12px; min-width: 164px; min-height: 66px; justify-content: center; padding: 12px 28px; border: 3px solid #533327; border-radius: 22px 15px 25px 14px; font-size: 30px; font-style: italic; letter-spacing: .5px; color: #fff4c7; text-shadow: 1px 2px 0 #872d24; background: #e85d39; transform: rotate(-3deg); box-shadow: 3px 7px 0 #533327,inset 0 4px 0 #ff9a62,0 12px 24px #233c3240; }
#start::before { content: ""; width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
#start:hover:not(:disabled) { background: #f26b3e; border-color: #533327; transform: rotate(-3deg) translateY(-2px); }
#start:active:not(:disabled) { transform: rotate(-3deg) translate(2px,5px); box-shadow: 1px 2px 0 #533327,inset 0 2px 0 #ff9a62; }
#progress { max-width: 90%; margin: 18px 0 0; padding: 4px 9px; border-radius: 6px; font-size: 12px; color: #fff9e8; background: #234d38; text-align: center; overflow-wrap: anywhere; }
#progress:empty { display: none; }
.status-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px 4px; }
#save-status { font-size: 11px; color: #4d605a; }
#save-status.error { color: #a02620; }
#help { min-height: 30px; padding: 4px 12px; background: #ffda5f; box-shadow: 1px 2px 0 #303e2b; }
.notice { margin: 4px 2px 1px; font-size: 10px; color: #59665f; }
#text-entry { padding: 10px; text-align: center; }
input { font: 16px "Trebuchet MS",Arial,sans-serif; padding: 8px; margin: 0 6px; max-width: 65vw; border: 1px solid #8b9b91; border-radius: 7px; background: #fffef6; }
dialog { width: min(490px,calc(100% - 24px)); max-height: 90dvh; padding: 22px; border: 3px solid #303e2b; border-radius: 18px 12px 22px 14px; background: #fff1bc; color: #23394b; box-shadow: 0 16px 60px #102b4260; }
dialog::backdrop { background: #112b428c; }
h2 { margin-top: 0; font-size: 20px; }
a { color: #174f80; }
.source-page { display: block; max-width: 720px; margin: 16px auto; padding: 24px; background: #fff9e9; border: 1px solid #b9c6b7; border-radius: 15px; }
.source-page h1 { color: #23394b; font-size: 22px; }
[hidden] { display: none !important; }
@media(max-width:700px) {
  body { padding: 8px max(6px,env(safe-area-inset-left)); }
  .site-shell { padding: 0 7px 7px; border-radius: 14px; }
  header { margin: 0 -7px; padding: 12px; }
  h1 { gap: 8px; font-size: 21px; letter-spacing: -.8px; }
  h1 span { padding: 3px 7px; font-size: 10px; }
  .baseball { flex-basis: 25px; width: 25px; height: 25px; }
  nav { gap: 8px; padding: 9px 0 13px; }
  nav button,nav .home-link { flex: 1 1 auto; min-height: 38px; padding: 6px 8px; font-size: 11px; }
  main { padding: 3px; border-radius: 9px; }
  #stage { width: 100%; }
  .notice { font-size: 9px; }
}
@media(orientation:landscape) and (max-height:550px) {
  body { padding: 0 max(5px,env(safe-area-inset-left)); }
  .site-shell { border-radius: 0 0 10px 10px; padding-bottom: 3px; }
  header { display: none; }
  nav { gap: 8px; padding: 4px 0 7px; justify-content: center; }
  nav button,nav .home-link { min-height: 30px; padding: 4px 10px; }
  #fullscreen { margin-left: 0; }
  main { padding: 2px; }
  #stage { width: min(100%,calc((100dvh - 126px)*4/3)); }
  .status-bar { padding: 4px 2px; }
  #help { min-height: 26px; padding: 3px 10px; }
  .notice { margin: 2px 2px; font-size: 9px; }
  #text-entry { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; background: #fff9e9; }
}
