* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f2a1d; color: #f2f7e6;
  font: 600 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
body[data-tool="water"] canvas { cursor: copy; }
body[data-tool="wind"] canvas { cursor: ew-resize; }
body[data-tool="dig"] canvas { cursor: not-allowed; }

.hud { position: fixed; left: 16px; top: 12px; pointer-events: none; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.hud h1 { margin: 0; font-size: 22px; letter-spacing: .02em; }
.hud p { margin: 2px 0 0; font-size: 13px; opacity: .92; }

.hint { position: fixed; left: 16px; bottom: 132px; margin: 0; font-size: 13px; opacity: .9; pointer-events: none; transition: opacity 1s;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.hint.gone { opacity: 0; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.group { display: flex; flex-wrap: wrap; gap: 4px; pointer-events: auto; }
.bar button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 2px solid #f2f7e6; background: rgba(12, 24, 18, .78);
  color: #f2f7e6; font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); transition: transform .08s; }
.bar button:hover { background: rgba(40, 70, 50, .9); }
.bar button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.bar button.on { background: #f2f7e6; color: #11261a; }
.bar button:focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; }
.bar button i { width: 12px; height: 12px; display: inline-block; border: 2px solid rgba(0, 0, 0, .35); }
#seeds[hidden] { display: flex; visibility: hidden; }

.toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, -8px); padding: 8px 14px; background: #f2f7e6; color: #11261a;
  border: 2px solid #11261a; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sharebox { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); padding: 16px;
  background: #11261a; border: 2px solid #f2f7e6; box-shadow: 0 6px 0 rgba(0, 0, 0, .4); }
.sharebox p { margin: 0 0 8px; }
.sharebox input { width: 100%; padding: 8px; font: inherit; font-size: 12px; background: #f2f7e6; color: #11261a; border: 0; -webkit-user-select: text; user-select: text; }
.sharebox button { margin-top: 10px; min-height: 34px; padding: 0 12px; border: 2px solid #f2f7e6; background: none; color: #f2f7e6; font: inherit; cursor: pointer; }

@media (max-width: 640px) {
  .bar button span { display: none; }
  .bar button { min-width: 40px; justify-content: center; padding: 0 6px; }
  .hud h1 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .toast, .hint { transition: none; } }
