:root {
  color-scheme: light;
  --paper: #edf1ef;
  --ink: #273c36;
  --muted: #75877f;
  --line: #cbd5ce;
  --red: #ed634a;
  --blue: #5775df;
  --mint: #b2cdbb;
  --yellow: #f4cc4e;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; overflow: hidden; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button { border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
button:disabled { opacity: .5; cursor: wait; }
button svg { width: 19px; height: 19px; stroke-width: 1.65; flex-shrink: 0; pointer-events: none; }
[hidden] { display: none !important; }
.header {
  height: 78px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 0 36px; border-bottom: 1px solid var(--line);
  position: relative; z-index: 3; background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 850; font-size: 23px; white-space: nowrap; }
.brand-light { font-weight: 400; margin-left: 3px; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; background: var(--ink); color: var(--paper); border-radius: 50%; }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 1.5; }
.header-caption { font-size: 12px; color: #657c70; }
.header-caption > span { margin: 0 13px; color: #aab9b0; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 38px; height: 38px; border-radius: 6px; display: inline-grid; place-items: center; background: transparent; }
.icon-button:hover { background: #dce4dd; }
.icon-button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.action-divider { height: 20px; width: 1px; background: var(--line); margin: 0 7px; }
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); pointer-events: none; position: absolute; z-index: 15; background: var(--ink); color: white; border-radius: 4px; padding: 7px 10px; font-size: 11px; font-weight: 400; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s; top: calc(100% + 9px); left: 50%; translate: -50% 0; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.header-actions > [data-tip]:last-child::after { left: auto; right: 0; translate: 0 0; }
#playground { position: relative; height: calc(100dvh - 78px); min-height: 320px; overflow: hidden; }
#world { display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -4px; cursor: grab; }
#world:active { cursor: grabbing; }
.scene-heading { position: absolute; top: 39px; left: 122px; pointer-events: none; user-select: none; }
.edition { display: flex; align-items: center; gap: 9px; color: #6e8277; font-size: 10px; font-weight: 600; }
.live-dot, .counter-dot { width: 6px; height: 6px; border-radius: 50%; background: #639a73; display: inline-block; }
h1 { margin: 23px 0 16px; font-size: 68px; line-height: 1.1; font-weight: 800; }
.title-dot { color: var(--red); }
.heading-caption { font-size: 9px; font-weight: 600; color: #84978c; }
.heading-caption span { margin: 0 8px; }
.scene-status { position: absolute; top: 38px; right: 38px; display: flex; align-items: center; gap: 9px; font-size: 11px; color: #74887b; pointer-events: none; }
.status-symbol { display: grid; place-items: center; width: 25px; height: 25px; background: #e2e9df; border-radius: 50%; }
.status-symbol svg { width: 14px; height: 14px; }
.tools { position: absolute; left: 28px; top: 40px; display: flex; flex-direction: column; padding: 7px; gap: 4px; background: #f9faf6; border: 1px solid #d3dcd2; border-radius: 8px; box-shadow: 0 4px 12px #263d3610; }
.tool { display: grid; place-items: center; width: 39px; height: 39px; background: transparent; border-radius: 5px; transition: background .15s; }
.tool:hover { background: #e4eae2; }
.tool.is-active { background: var(--ink); color: #f9faf6; }
.tool svg { width: 19px; height: 19px; }
.tools [data-tip]::after { top: 50%; left: calc(100% + 14px); translate: 0 -50%; transform: translateX(-4px); }
.tools [data-tip]:hover::after { transform: translateX(0); }
.tool-divider { height: 1px; background: #dde3da; margin: 4px 6px; }
.play-actions { position: absolute; bottom: 106px; left: 31px; display: flex; gap: 9px; }
.rain-button { background: var(--red); color: #fffef6; height: 44px; padding: 0 16px; border: 1px solid #c74f39; border-radius: 5px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; box-shadow: 0 3px 0 #ad4936; transition: translate .12s, box-shadow .12s; }
.rain-button:hover { background: #e95a42; translate: 0 -2px; box-shadow: 0 5px 0 #ad4936; }
.rain-button:active { translate: 0 2px; box-shadow: 0 1px 0 #ad4936; }
.rain-button .arrow { width: 15px; height: 15px; margin-left: 8px; }
.shake-button { display: grid; place-items: center; width: 44px; height: 44px; background: #f9faf6; border: 1px solid #cbd5ca; border-radius: 5px; }
.shake-button:hover { background: #e0e8da; }
.bottom-bar { position: absolute; display: flex; align-items: center; bottom: 19px; left: 30px; right: 30px; height: 43px; gap: 30px; }
.scene-picker { position: relative; }
.scene-button { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #b7c8b9; border-radius: 5px; background: #e9efe7; font-size: 12px; min-width: 160px; }
.scene-button:hover { background: #f1f5ee; }
.scene-button .chevron { width: 15px; margin-left: auto; }
.scene-button[aria-expanded="true"] .chevron { rotate: 180deg; }
.scene-menu { position: absolute; left: 0; bottom: 54px; width: 236px; padding: 6px; border-radius: 7px; border: 1px solid var(--line); background: #fbfcf8; box-shadow: 0 10px 30px #21372920; }
.scene-menu button { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 8px; background: transparent; text-align: left; font-size: 13px; border-radius: 4px; }
.scene-menu button:hover { background: #e9eee5; }
.scene-menu small { display: block; margin-top: 4px; font-size: 8px; color: #829082; }
.scene-menu button > svg { margin-left: auto; width: 16px; opacity: 0; }
.scene-menu button[aria-pressed="true"] > svg { opacity: 1; }
.scene-swatch { width: 33px; height: 33px; border: 1px solid #273c3630; display: block; flex-shrink: 0; }
.garden-swatch { background: var(--yellow); border-radius: 50%; }
.space-swatch { background: var(--blue); border-radius: 5px; rotate: -12deg; }
.domino-swatch { background: var(--red); width: 17px; margin: 0 8px; border-radius: 3px; }
.gravity-control { display: flex; align-items: center; gap: 13px; }
.gravity-control label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #5a7161; white-space: nowrap; }
.gravity-control label svg { width: 14px; height: 14px; }
input[type="range"] { width: 130px; accent-color: var(--ink); height: 22px; cursor: pointer; }
output { font-size: 11px; min-width: 31px; font-variant-numeric: tabular-nums; }
.world-counter { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.counter-dot { width: 5px; height: 5px; }
.counter-unit { color: #6d8270; }
.clear-button { margin-left: -15px; }
.bottom-bar [data-tip]::after { top: auto; bottom: calc(100% + 9px); }
.toast { position: absolute; bottom: 87px; left: 50%; transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 5px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s; white-space: nowrap; z-index: 20; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.error-panel { position: absolute; top: 50%; left: 50%; translate: -50% -50%; background: #fbfcf8; padding: 24px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; text-align: center; }
.error-panel button { display: block; margin: 18px auto 0; padding: 10px 20px; background: var(--ink); color: white; border-radius: 4px; }
@media (min-width: 1600px) {
  .scene-heading { top: 49px; left: 143px; }
  h1 { font-size: 84px; }
  .tools { left: 36px; top: 50px; }
}
@media (max-width: 850px) {
  .header { padding: 0 22px; height: 68px; }
  .brand { font-size: 21px; gap: 9px; }
  .header-caption { display: none; }
  #playground { height: calc(100dvh - 68px); }
  .scene-heading { left: 105px; top: 30px; }
  h1 { font-size: 57px; margin-top: 19px; }
  .tools { left: 20px; top: 30px; }
  .scene-status { top: 30px; right: 22px; }
  .gravity-control { gap: 8px; }
  input[type="range"] { width: 90px; }
  .bottom-bar { left: 22px; right: 22px; gap: 20px; }
}
@media (max-width: 560px) {
  .header { height: 62px; padding: 0 16px; gap: 12px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .header-actions { gap: 1px; }
  .icon-button { width: 31px; height: 34px; }
  .action-divider { display: none; }
  .header-actions svg { width: 17px; height: 17px; }
  #playground { height: calc(100dvh - 62px); }
  .scene-heading { left: 78px; top: 26px; }
  .edition { font-size: 7px; gap: 6px; }
  .live-dot { width: 4px; height: 4px; }
  h1 { font-size: 44px; margin: 17px 0 12px; }
  .heading-caption { font-size: 7px; }
  .heading-caption span { margin: 0 4px; }
  .scene-status { display: none; }
  .tools { top: 25px; left: 13px; padding: 4px; gap: 2px; }
  .tool { width: 32px; height: 34px; }
  .tool svg { width: 17px; height: 17px; }
  .tool-divider { margin: 3px 6px; }
  .play-actions { left: 16px; bottom: 135px; }
  .rain-button { height: 40px; padding: 0 12px; font-size: 11px; gap: 7px; }
  .shake-button { width: 40px; height: 40px; }
  .rain-button .arrow { margin-left: 4px; width: 13px; }
  .bottom-bar { left: 16px; right: 16px; bottom: max(12px, env(safe-area-inset-bottom)); height: 94px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 42px 38px; gap: 8px 16px; }
  .scene-button { min-width: 150px; width: 100%; height: 38px; font-size: 11px; }
  .scene-button > svg { width: 16px; }
  .scene-menu { bottom: 48px; width: 226px; }
  .world-counter { grid-column: 2; grid-row: 1; margin: 0; justify-self: end; font-size: 10px; gap: 5px; }
  .gravity-control { grid-column: 1; grid-row: 2; gap: 7px; }
  .gravity-control label { font-size: 10px; gap: 3px; }
  input[type="range"] { width: 106px; min-width: 45px; flex-shrink: 1; margin: 0; }
  output { font-size: 10px; min-width: 28px; }
  .clear-button { grid-column: 2; grid-row: 2; margin: 0; justify-self: end; }
  .toast { bottom: 120px; font-size: 11px; max-width: calc(100% - 30px); white-space: normal; text-align: center; }
}
@media (max-width: 360px) {
  .brand { font-size: 15px; }
  .brand-mark { display: none; }
  .header { gap: 5px; padding: 0 12px; }
  .bottom-bar { gap: 8px; }
  .gravity-control { gap: 4px; }
  input[type="range"] { width: 75px; }
}
@media (max-height: 520px) and (min-width: 561px) {
  .tools { top: 15px; padding: 5px; gap: 1px; }
  .tool { width: 30px; height: 28px; }
  .tool svg { width: 16px; height: 16px; }
  .tool-divider { margin: 2px 5px; }
  .scene-heading { top: 19px; left: 100px; }
  h1 { font-size: 40px; margin: 14px 0 10px; }
  .play-actions { left: 105px; bottom: 101px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; }
}
