/* 蕩蕩：会場の楽器。地と文字はチラシ表・1nei.jp/tsuzuki と同じ（灰の地＋砂目、温めた白、円の線の緑） */
:root {
  --ground: #585657;
  --ink: #F1F0EC;
  --ink-2: rgba(241, 240, 236, .66);
  --ink-3: rgba(241, 240, 236, .38);
  --rule: rgba(241, 240, 236, .18);
  --green: #36B280;
  --f: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--ground) url(grain-soft.png) 0 0 / 256px 256px repeat;
  color: var(--ink); font-family: var(--f); font-weight: 300; letter-spacing: .08em;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
#water { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* これまでに足された粒の数。ロゴと水面のあいだに */
#count { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; }

/* チラシ表の円（斜線の緑）。チラシと同じく画面の上寄りに置く */
.flyer { position: fixed; inset: 0; pointer-events: none; display: grid; justify-items: center; }
.flyer img {
  width: min(86vw, 58svh, 620px); aspect-ratio: 1; height: auto; display: block;
  margin-top: calc(env(safe-area-inset-top) + min(14svh, 120px));
}

/* 自然の音：下にアイコンで並べる。鳴っているものは白、休んでいるものは薄く */
.beds {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; justify-content: center; gap: clamp(18px, 7vw, 36px);
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(88, 86, 87, .92), rgba(88, 86, 87, 0));
}
.beds button {
  appearance: none; border: 0; background: none; color: var(--ink-3);
  padding: 8px 6px 10px; position: relative; transition: color .8s ease;
}
.beds svg { display: block; width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.beds svg circle { fill: currentColor; stroke: none; }
.beds button::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 0; height: 1px; background: var(--green);
  transition: width .8s ease, left .8s ease;
}
.beds button.on { color: var(--ink); }
.beds button.on::after { width: 100%; left: 0; }

.hint {
  position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 28px); margin: 0; z-index: 2;
  text-align: center; font-size: 13px; color: var(--ink-2); letter-spacing: .24em;
  opacity: 0; transition: opacity 2.4s ease; pointer-events: none;
}
.hint.show { opacity: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 遊んでいる画面の右上：設定。来場者の目に立たないよう薄く */
.gear {
  position: fixed; z-index: 3; top: calc(env(safe-area-inset-top) + 10px); right: 10px;
  appearance: none; border: 0; background: none; padding: 8px; color: var(--ink-3); opacity: .7;
}
.gear[hidden] { display: none; }
.gear svg { display: block; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; }
.gear svg circle { fill: var(--ground); stroke: currentColor; }

.start {
  position: fixed; inset: 0; z-index: 5; display: grid; align-items: end; justify-items: center;
  padding: 32px 32px calc(env(safe-area-inset-bottom) + 3svh);
  background: linear-gradient(to top, rgba(88, 86, 87, .96) 34%, rgba(88, 86, 87, .25) 70%, rgba(88, 86, 87, 0));
  transition: opacity 1.2s ease;
}
.start.gone { opacity: 0; pointer-events: none; }
.start-in { max-width: 22rem; text-align: center; }
.start h1 { margin: 0 0 20px; font-weight: 200; font-size: 40px; letter-spacing: .5em; text-indent: .5em; }
.start p { margin: 0 0 28px; font-size: 14px; line-height: 2; color: var(--ink-2); }
.start button {
  appearance: none; font: inherit; color: var(--ink); background: none; letter-spacing: .4em; text-indent: .4em;
  border: 1px solid var(--rule); border-radius: 999px; padding: 14px 40px; font-size: 15px;
}
.start button:active { border-color: var(--green); }

/* 設定。開始画面の「設定」か、鳴らしている間は左上の角を長押し */
.settings-link { display: block; margin: 18px auto 0; border: 0 !important; padding: 8px 16px !important; font-size: 12px !important; color: var(--ink-2) !important; letter-spacing: .3em; }
.sheet {
  position: fixed; inset: 0; z-index: 6; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--ground) url(grain-soft.png) 0 0 / 256px 256px repeat;
  padding: calc(env(safe-area-inset-top) + 8px) 24px calc(env(safe-area-inset-bottom) + 32px);
}
.sheet[hidden] { display: none; }
.sheet-hd { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; background: inherit; z-index: 1; }
.sheet-hd h1 { margin: 0; font-weight: 300; font-size: 17px; letter-spacing: .5em; }
.sheet-hd button { appearance: none; border: 0; background: none; color: var(--ink); padding: 6px; margin-right: -6px; }
.sheet svg { display: block; width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.sheet svg circle, .sheet svg .fill { fill: currentColor; stroke: none; }
.sheet svg circle.line { fill: none; stroke: currentColor; }
.sheet-in { max-width: 30rem; margin: 0 auto; }
.sheet section { border-top: 1px solid var(--rule); padding: 20px 0 24px; }
.sheet h2 { margin: 0 0 16px; font-size: 12px; font-weight: 300; color: var(--ink-2); letter-spacing: .3em; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tile-w { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tile {
  appearance: none; width: 100%; max-width: 60px; aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; padding: 0;
  background: rgba(0, 0, 0, .1); border: 1px solid var(--rule); color: var(--ink-3); transition: color .4s, border-color .4s, background .4s;
}
.tile.on { color: var(--ink); border-color: var(--green); background: rgba(54, 178, 128, .12); }
.play { appearance: none; border: 0; background: none; color: var(--ink-2); padding: 0; }
.play svg { width: 28px; height: 28px; }
.play:active { color: var(--green); }
.sheet input[type=range] { width: 100%; accent-color: var(--green); }
.seg { display: flex; gap: 8px; }
.seg button, .wide {
  appearance: none; font: inherit; font-size: 13px; color: var(--ink-2); background: none; letter-spacing: .1em;
  border: 1px solid var(--rule); border-radius: 999px; padding: 9px 0; flex: 1;
}
.seg button.on { color: var(--ink); border-color: var(--green); }
.wide { width: 100%; padding: 12px; }
.wide:disabled { opacity: .45; }
.wide:not(:disabled):active { border-color: var(--green); }
.sheet-st { margin: 8px 0 0; font-size: 11px; line-height: 1.9; color: var(--ink-3); letter-spacing: .04em; }
.sheet-count { margin: 0 0 14px; font-size: 14px; letter-spacing: .06em; color: var(--ink); }
.sheet .wide + .sheet-st { margin-top: 12px; }
.settings-link[hidden] { display: none; }
.sheet .wide + .wide { margin-top: 10px; }
.wide.danger { color: rgba(241, 240, 236, .6); }
.wide.danger.armed { color: var(--ink); border-color: #c98a7e; background: rgba(201, 138, 126, .12); }
