/* らくがき すいぞくかん — 見た目。ライト=昼の水そう・ダーク=夜の水そう。外部フォントは使わない(何も送らないため)
   動くものは transform と opacity だけ(さかな・あわ・えさ・海そう)。 */
:root {
  --bg: #e4f6ff;
  --ink: #2b2433;
  --sub: #566175;
  --card: #ffffff;
  --card-sh: #b7d2e6;
  --gold: #ffb800;
  --gold-sh: #c98a00;
  --pen: #ff8a3d;
  --pen-sh: #d2621c;
  --focus: #2f7cf6;
  --w-top: #c9eeff;
  --w-mid: #8fd5f5;
  --w-bot: #5bbce6;
  --ray: rgba(255, 255, 255, .26);
  --sand: #f3dfab;
  --sand-sh: #e0c381;
  --weed1: #3ebd7c;
  --weed2: #2a9f66;
  --rock: #a3b6ca;
  --rock-sh: #7e95ad;
  --paper: #fffdf8;
  --pad-sh: #b7d2e6;
  --dim: rgba(18, 38, 66, .55);
  --food: #c4712c;
  --bub: rgba(255, 255, 255, .9);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1730;
    --ink: #eef4ff;
    --sub: #a9b8cf;
    --card: #1f2f4d;
    --card-sh: #08101f;
    --focus: #ffb800;
    --w-top: #14345f;
    --w-mid: #0e2649;
    --w-bot: #0a1a35;
    --ray: rgba(150, 195, 255, .08);
    --sand: #3d4868;
    --sand-sh: #2b3450;
    --weed1: #2a8a67;
    --weed2: #1f6e53;
    --rock: #4e5f80;
    --rock-sh: #36445f;
    --paper: #f4efe5;
    --pad-sh: #050b18;
    --dim: rgba(0, 0, 0, .62);
    --food: #e3a35f;
    --bub: rgba(200, 225, 255, .75);
  }
}

/* すいそうの ひる・よる(ボタンで きりかえ。はじめは 画面の いろ か とけい)。水の 中の いろだけ かえる。
   class(day/night)と 変数は さかなの いない 所(.water の 背景・.rays・.deco・.fx・.visitor)に じかに つける:
   親(.tank)に つけると きりかえの たびに さかな ぜんぶの style を 計算しなおして おそい(11/2 reviewer: 6倍おそくで 92ms) */
.day:is(.rays, .deco, .fx, .visitor) {
  --w-top: #c9eeff; --w-mid: #8fd5f5; --w-bot: #5bbce6; --ray: rgba(255, 255, 255, .26);
  --sand: #f3dfab; --sand-sh: #e0c381; --weed1: #3ebd7c; --weed2: #2a9f66; --rock: #a3b6ca; --rock-sh: #7e95ad;
  --food: #c4712c; --bub: rgba(255, 255, 255, .9); --ghost: rgba(18, 62, 112, .17);
}
.night:is(.rays, .deco, .fx, .visitor) {
  --w-top: #102a52; --w-mid: #0c2045; --w-bot: #081634; --ray: rgba(150, 195, 255, .07);
  --sand: #3a4566; --sand-sh: #29324d; --weed1: #24806a; --weed2: #1b6553; --rock: #4a5a7a; --rock-sh: #34425d;
  --food: #e3a35f; --bub: rgba(200, 225, 255, .75); --ghost: rgba(150, 205, 255, .15);
}
.water.day { background: linear-gradient(180deg, #c9eeff 0%, #8fd5f5 45%, #5bbce6 100%); }
.water.night { background: linear-gradient(180deg, #102a52 0%, #0c2045 45%, #081634 100%); }
/* すむ ところ(11/14): いけ=みどりの 水と どろ・どうぶつ/むし=そらと くさはら(くもが とおる) */
.day.pond:is(.rays, .deco, .fx, .visitor) {
  --w-top: #c6efd8; --w-mid: #86d2ab; --w-bot: #4fae86;
  --sand: #b89c74; --sand-sh: #9a7f58; --weed1: #3f9e4f; --weed2: #2f7f3e; --rock: #9c9384; --rock-sh: #7c7466; --ghost: rgba(160, 60, 20, .16);
}
.night.pond:is(.rays, .deco, .fx, .visitor) {
  --w-top: #0f3a33; --w-mid: #0b2e29; --w-bot: #08211d;
  --sand: #3d3a30; --sand-sh: #2c2a22; --weed1: #24705a; --weed2: #1b5745; --rock: #4c4a44; --rock-sh: #36352f; --ghost: rgba(255, 170, 120, .14);
}
.day:is(.land, .bug):is(.rays, .deco, .fx, .visitor) {
  --w-top: #8fd3ff; --w-mid: #c8ecff; --w-bot: #fff4d0;
  --sand: #8ed66b; --sand-sh: #6cbf4f; --weed1: #4fb35a; --weed2: #3a9a48; --rock: #b8b1a6; --rock-sh: #958d80;
  --ghost: rgba(255, 255, 255, .95); --cloud: rgba(255, 255, 255, .9); --ray: rgba(255, 250, 220, .22); --bub: rgba(255, 255, 255, .95);
}
.night:is(.land, .bug):is(.rays, .deco, .fx, .visitor) {
  --w-top: #0b1838; --w-mid: #14285a; --w-bot: #22386a;
  --sand: #2f5a3c; --sand-sh: #23452e; --weed1: #2c6e45; --weed2: #225838; --rock: #4f5568; --rock-sh: #383d4d;
  --ghost: rgba(200, 215, 255, .22); --cloud: rgba(200, 215, 255, .16); --ray: rgba(150, 195, 255, .05);
}
.water.day.pond { background: linear-gradient(180deg, #c6efd8 0%, #86d2ab 45%, #4fae86 100%); }
.water.night.pond { background: linear-gradient(180deg, #0f3a33 0%, #0b2e29 45%, #08211d 100%); }
.water.day:is(.land, .bug) { background: linear-gradient(180deg, #8fd3ff 0%, #c8ecff 50%, #fff4d0 100%); }
.water.night:is(.land, .bug) { background: linear-gradient(180deg, #0b1838 0%, #14285a 55%, #22386a 100%); }
.water.day.bug { background: linear-gradient(180deg, #a6e0ff 0%, #ddf6ff 50%, #fff8e0 100%); }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden;
}
#app { position: fixed; inset: 0; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.screen { position: absolute; inset: 0; }

/* ---- 押すもの(カード) ---- */
.back {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 64px; min-width: 64px; padding: 0 16px 0 10px;
  border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  font-weight: 800; font-size: 18px;
}
.back span { font-size: 34px; line-height: 1; margin-top: -5px; }
.back:active, .tbtn:active, .snd:active, .tool:active, .sw:active, .card:active, .arrow:active, .done:active {
  transform: translateY(3px);
}

/* =====================================================================
   すいそう
   ===================================================================== */
.water {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--w-top) 0%, var(--w-mid) 45%, var(--w-bot) 100%);
  touch-action: none;
}
/* すいそうの 中: 画面より 大きい(JS が はばと たかさ・寄りと ずらしを きめる) */
.world { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; }
.lifter { z-index: 5; pointer-events: none; } /* もって いる ものだけ ここに うつす。world は かさなりの 箱を つくるので、中の z-index では はこ(z 4)を こえられない。world ごと 上げると ほかの さかなや ひかりも はこに かぶさる(11/14 reviewer) */
.rays {
  position: absolute; inset: 0;
  background:
    linear-gradient(104deg, transparent 14%, var(--ray) 18%, transparent 25%),
    linear-gradient(104deg, transparent 40%, var(--ray) 45%, transparent 51%),
    linear-gradient(104deg, transparent 66%, var(--ray) 70%, transparent 76%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}
.deco { position: absolute; inset: 0; pointer-events: none; }
.sand { position: absolute; left: 0; right: 0; bottom: 0; height: max(58px, 11vh); }
.sand svg { display: block; width: 100%; height: 100%; }
.sand path { fill: var(--sand); }
.sand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, transparent, var(--sand-sh)); opacity: .5; }
.weed { position: absolute; bottom: calc(max(58px, 11vh) * .45); transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite alternate; }
.weed svg { display: block; width: 100%; height: 100%; }
.weed path { fill: var(--weed1); }
.w1 { left: 4%; width: 46px; height: min(30vh, 260px); animation-duration: 5.4s; }
.w2 { left: 11%; width: 36px; height: min(20vh, 170px); animation-duration: 4.4s; animation-delay: -1.5s; }
.w2 path, .w4 path { fill: var(--weed2); }
.w3 { right: 7%; width: 50px; height: min(26vh, 230px); animation-duration: 6s; animation-delay: -2.2s; }
.w4 { right: 16%; width: 34px; height: min(17vh, 150px); animation-duration: 4.8s; animation-delay: -.7s; }
.w5 { left: 42%; width: 40px; height: min(24vh, 210px); animation-duration: 5.1s; animation-delay: -3s; }
.w6 { left: 60%; width: 32px; height: min(15vh, 130px); animation-duration: 4.6s; animation-delay: -1.1s; }
.w6 path { fill: var(--weed2); }
@keyframes sway { from { transform: skewX(-7deg); } to { transform: skewX(7deg); } }
.rock { position: absolute; border-radius: 50% 50% 38% 38%; background: var(--rock); box-shadow: inset -8px -6px 0 var(--rock-sh); }
.r1 { left: 20%; bottom: calc(max(58px, 11vh) * .4); width: 74px; height: 40px; }
.r2 { right: 27%; bottom: calc(max(58px, 11vh) * .5); width: 50px; height: 30px; }
.r3 { left: 52%; bottom: calc(max(58px, 11vh) * .35); width: 62px; height: 34px; }
.bubbler { position: absolute; bottom: calc(max(58px, 11vh) * .55); width: 20px; height: 1px; }
.b1 { left: 31%; }
.b2 { right: 12%; }
.bubbler i {
  position: absolute; left: 4px; bottom: 0; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bub); opacity: 0;
  animation: amb 4.8s ease-in infinite;
}
.bubbler i:nth-child(2) { animation-delay: 2.4s; left: 8px; width: 7px; height: 7px; }
/* ---- すむ ところの けしき(.deco に すむ ところの class。うごくのは 花だけ) ---- */
.sky, .tree, .flw { display: none; }
.deco:is(.land, .bug) .sky { display: block; }
.deco.land .tree, .deco.bug .flw { display: block; }
.deco:is(.land, .bug) .bubbler, .deco.land .weed { display: none; }
.deco.bug .weed { height: min(12vh, 100px); }
.sky { position: absolute; inset: 0; }
.sky .sun { position: absolute; left: 34%; top: 17%; width: 16vmin; height: 16vmin; border-radius: 50%; background: #ffd84d; box-shadow: 0 0 0 2.4vmin rgba(255, 216, 77, .35); }
.cld { position: absolute; height: 8vmin; border-radius: 5vmin; background: var(--cloud); }
.cld::before, .cld::after { content: ""; position: absolute; bottom: 30%; border-radius: 50%; background: inherit; }
.cld::before { left: 18%; width: 34%; height: 140%; }
.cld::after { left: 44%; width: 42%; height: 190%; }
.c1 { left: 6%; top: 26%; width: 26vmin; } .c2 { left: 52%; top: 20%; width: 20vmin; } .c3 { left: 72%; top: 34%; width: 24vmin; }
.stars { position: absolute; inset: 0 0 50% 0; opacity: 0; background:
  radial-gradient(2px 2px at 12% 20%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 28% 8%, #fff 50%, transparent 51%),
  radial-gradient(2px 2px at 44% 30%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 62% 14%, #fff 50%, transparent 51%),
  radial-gradient(2px 2px at 78% 36%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 90% 10%, #fff 50%, transparent 51%),
  radial-gradient(2px 2px at 6% 44%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 36% 52%, #fff 50%, transparent 51%); }
.deco.night .stars { opacity: .9; }
.deco.night .sky .sun { background: #fff3c4; box-shadow: 0 0 0 1.4vmin rgba(255, 243, 196, .18); }
.tree { position: absolute; bottom: calc(max(58px, 11vh) * .5); width: 30vmin; height: 50vmin; }
.tree svg, .flw svg { display: block; width: 100%; height: 100%; }
.t1 { left: 3%; } .t2 { right: 5%; width: 24vmin; height: 40vmin; } .t3 { left: 56%; width: 18vmin; height: 30vmin; }
.trunk { fill: #a0683a; } .crown { fill: var(--weed1); } .crown2 { fill: var(--weed2); }
.flw { position: absolute; bottom: calc(max(58px, 11vh) * .5); width: 9vmin; height: 21vmin; transform-origin: 50% 100%; animation: sway 4.6s ease-in-out infinite alternate; }
.f1 { left: 18%; } .f2 { left: 36%; height: 16vmin; animation-delay: -1.2s; } .f3 { right: 22%; animation-delay: -2.4s; } .f4 { right: 40%; height: 18vmin; animation-delay: -.6s; }
.stem { fill: none; stroke: var(--weed2); stroke-width: 6; } .leaf { fill: var(--weed1); }
.f1 .pet { fill: #ff8fb8; } .f2 .pet { fill: #ffd84d; } .f3 .pet { fill: #b49cff; } .f4 .pet { fill: #ff9f6b; } .ctr { fill: #ffe9a8; }
.deco.night .flw, .deco.night .tree { filter: brightness(.6); }
/* いけ: 水草の さきに がま の ほ */
.deco.pond .weed::after { content: ""; position: absolute; left: 30%; top: -4%; width: 40%; height: 16%; border-radius: 40%; background: #9a6a3c; }
@keyframes amb {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  10% { opacity: .9; }
  50% { transform: translate3d(6px, -24vh, 0); }
  90% { opacity: .5; }
  100% { transform: translate3d(-4px, -50vh, 0); opacity: 0; }
}

.swim, .fx { position: absolute; inset: 0; pointer-events: none; }
/* .fish は 位置・かたむき・頭の向き(JS の Web Animations)。.fbody は ゆれ */
.fish { position: absolute; left: 0; top: 0; will-change: transform; }
.fbody { position: absolute; inset: 0; }
.half, .whole { position: absolute; top: 0; height: 100%; background-repeat: no-repeat; }
.whole { left: 0; width: 100%; background-size: 100% 100%; }
/* しっぽがわを つけねで ゆらす(頭が右の絵は左半分、頭が左の絵は右半分) */
.fish.swim .tail { transform-origin: 100% 50%; animation: wag var(--wag, .7s) ease-in-out infinite alternate; }
.fish.swim.lf .tail { transform-origin: 0 50%; }
@keyframes wag { from { transform: skewY(-8deg); } to { transform: skewY(8deg); } }
.fish.float .whole { transform-origin: 50% 30%; animation: pulse var(--pulse, 1.7s) ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1, 1); } 45% { transform: scale(1.06, .9); } }
.fish.walk .whole { transform-origin: 50% 90%; animation: waddle .45s ease-in-out infinite alternate; }
.swim.land .fish.walk .whole { transform-origin: 50% 100%; animation: hop .5s cubic-bezier(.3, 0, .6, 1) infinite alternate; } /* どうぶつは ぴょんぴょん */
@keyframes hop { from { transform: translateY(0) scale(1.03, .97); } to { transform: translateY(-9%) scale(.98, 1.02); } }
@keyframes waddle { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.fish.float .fbody { animation: bobF var(--bob, 3.6s) ease-in-out infinite alternate; }
@keyframes bobF { from { transform: translateY(-6px); } to { transform: translateY(6px); } }
/* 11ぴき以上(JS の CROWD)は ゆれを止める。動く要素が多いほど、さわってから画面に出るまでが のびるため(演出より軽さ)。
   生まれる・食べるの 1回だけの動きは のこす */
#swim.crowd .tail, #swim.crowd .whole, #swim.crowd .fish:not(.born) .fbody:not(.gulp) { animation: none; }
.fish.born .fbody { animation: born .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes born { from { transform: scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }
.fish .fbody.gulp { animation: gulp .3s ease-out; }
@keyframes gulp { 40% { transform: scale(1.12); } }
/* ほし・ハート・しずく・よるの ひかり */
.spark { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: center / contain no-repeat; animation: spark .95s ease-out both; }
@keyframes spark { 0% { transform: scale(.3); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-28px) scale(1); opacity: 0; } }
.spark.heart { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18'%3E%3Cpath d='M10 17C4 12 1 9 1 5.5A4.5 4.5 0 0 1 10 4a4.5 4.5 0 0 1 9 1.5C19 9 16 12 10 17z' fill='%23ff5c8a' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.spark.star { width: 22px; height: 22px; margin: -11px 0 0 -11px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1l2.6 5.6 6.1.7-4.5 4.2 1.2 6L10 14.5 4.6 17.5l1.2-6L1.3 7.3l6.1-.7z' fill='%23ffd32a' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.spark.rain { width: 6px; height: 14px; margin: -7px 0 0 -3px; border-radius: 3px; background: #6ec6ff; animation: rain .9s ease-in both; }
@keyframes rain { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(80px); opacity: 0; } }
.spark.drop { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--bub); }
.spark.glow { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: radial-gradient(circle, #fffbd2 0 22%, rgba(255, 236, 120, .55) 38%, rgba(255, 236, 120, 0) 70%); }
.zz { position: absolute; font-weight: 900; font-size: 20px; line-height: 1; color: rgba(225, 238, 255, .9); animation: zz 2.5s ease-out both; }
@keyframes zz { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(16px, -62px) scale(1.25); opacity: 0; } }
.ripple.glow { border-color: rgba(255, 238, 140, .9); }
/* さわれる おおきな あわ */
.bigbub {
  position: absolute; border-radius: 50%; will-change: transform;
  border: 3px solid var(--bub);
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .85) 0 11%, rgba(255, 255, 255, .14) 13%, rgba(255, 255, 255, .06) 70%);
}
.bigbub.soap { border-color: rgba(255, 255, 255, .95); background: radial-gradient(circle at 32% 30%, #fff 0 10%, rgba(255, 255, 255, 0) 14%), conic-gradient(rgba(255, 150, 220, .3), rgba(150, 220, 255, .3), rgba(255, 240, 150, .3), rgba(255, 150, 220, .3)); }
/* おおきな おきゃくさん(くじらの かげ。さかなより おく) */
.visitor { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.visitor svg { display: block; width: 100%; height: 100%; }
.visitor path { fill: var(--ghost); }
.v-eye { fill: rgba(255, 255, 255, .4); }
.rays.night { opacity: .5; }
/* かざり(さかなより おく。うごかすのは JS の transform。よるは くらく、ひかる ところ(.glow)だけ そのまま) */
/* isolation: かざりの z-index(てまえほど うえ)を この 中だけで くらべる(ないと さかな・ボタン・まくより 上に 出る。11/2 reviewer) */
.decor { position: absolute; inset: 0; pointer-events: none; isolation: isolate; will-change: transform; }
.decor.lifting { z-index: 5; } /* もって いる あいだは はこより てまえ */
.dc { position: absolute; left: 0; top: 0; }
.dc svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 100%; }
.dc .part { transform-box: fill-box; }
.dc .lid, .dc .top { transform-origin: 0 100%; }
.dc .tent { transform-origin: 50% 100%; }
.dc .glow { opacity: 0; }
.decor.night .glow { opacity: 1; }
.decor.night .main { filter: brightness(.62) saturate(.85); }
/* かざる あいだ: うごかせる しるし(てんせん)。もって いる ものは すこし おおきく */
.decor.edit .dc::after { content: ""; position: absolute; inset: -5px; border: 3px dashed rgba(255, 255, 255, .85); border-radius: 14px; }
.decor.edit .dc.lift::after { border-color: #ffd34d; border-style: solid; }
.dc.lift { will-change: transform; }
.fish.held { z-index: 6; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .3)); } /* もって いる さかなは はこより てまえ */
.fish.held .fbody { transform: scale(1.1); }
/* うく かざり: ゆらゆら(つつむ .bob を うごかす。さわった ときの svg の うごきと べつ) */
.dc.float svg { transform-origin: 50% 50%; }
.dc .bob { position: absolute; inset: 0; animation: bob 3.4s ease-in-out var(--bd, 0s) infinite alternate; }
@keyframes bob { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
.dc.lift .main { transform: scale(1.08); }
.deco-btn {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + 104px); left: calc(12px + env(safe-area-inset-left));
  width: 72px; height: 72px; border-radius: 20px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-weight: 900; font-size: 14px; letter-spacing: .04em; line-height: 1;
}
.deco-btn:active { transform: translateY(3px); }
.deco-btn svg { width: 40px; height: 40px; }
.ic-lid { fill: #d98a49; stroke: #2b2433; stroke-width: 2.5; stroke-linejoin: round; }
.ic-box { fill: #c9773a; stroke: #2b2433; stroke-width: 2.5; }
.ic-band { fill: none; stroke: #ffc93d; stroke-width: 4; }
.ic-lock { fill: #ffe27a; stroke: #2b2433; stroke-width: 2; }
.ic-star { fill: #ffd32a; stroke: #2b2433; stroke-width: 1.5; stroke-linejoin: round; }
.deco-bar {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; justify-content: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 12px calc(12px + env(safe-area-inset-left));
  background: rgba(255, 255, 255, .55); border-radius: 0 0 26px 26px;
}
@media (prefers-color-scheme: dark) { .deco-bar { background: rgba(14, 30, 62, .62); } }
/* かざりを もつと はこが「しまう はこ」に かわる。ここに きたら きいろく なって ふたが ひらく */
.deco-bin {
  position: absolute; inset: calc(6px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left));
  display: none; align-items: center; justify-content: center; gap: 10px;
  border: 4px dashed var(--ink); border-radius: 22px; color: var(--ink); font-weight: 900; font-size: 20px; letter-spacing: .04em; pointer-events: none;
}
.deco-bin svg { width: 64px; height: 64px; flex-shrink: 0; transition: transform .15s; }
.bin-box { fill: #c9773a; stroke: #2b2433; stroke-width: 2.5; stroke-linejoin: round; }
.bin-flap { fill: #d98a49; stroke: #2b2433; stroke-width: 2.5; stroke-linejoin: round; transition: transform .15s; transform-box: fill-box; }
.bin-flap.l { transform-origin: 100% 100%; }
.bin-flap.r { transform-origin: 0 100%; }
.bin-arrow { fill: none; stroke: #2f7cf6; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.deco-bar.hold .deco-bin { display: flex; }
.deco-bar.hold > .deco-done, .deco-bar.hold > .tray { visibility: hidden; }
.deco-bar.drop { background: rgba(255, 214, 90, .85); box-shadow: inset 0 -4px 0 #ffb800; }
.deco-bar.drop .deco-bin { border-style: solid; color: #3a2a00; border-color: #3a2a00; }
.deco-bar.drop .deco-bin svg { transform: scale(1.15); }
.deco-bar.drop .bin-flap.l { transform: rotate(-35deg); }
.deco-bar.drop .bin-flap.r { transform: rotate(35deg); }
@media (prefers-color-scheme: dark) { .deco-bin { color: #fff; border-color: #fff; } }
.deco-done {
  flex-shrink: 0; width: 64px; min-height: 64px; padding: 4px 0 6px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--gold); color: #3a2a00; box-shadow: 0 4px 0 var(--gold-sh); font-weight: 900; font-size: 14px; line-height: 1;
}
.deco-done:active, .ditem:active { transform: translateY(3px); }
.deco-done svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.tray { display: grid; grid-template-columns: repeat(4, 64px); grid-auto-rows: 64px; gap: 6px 6px; }
.ditem { border-radius: 16px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh); display: grid; place-items: center; }
.ditem svg { width: 50px; height: 50px; overflow: visible; }
.tray.full .ditem { opacity: .45; }
.tray.shake { animation: sideways .3s; }
/* 360 まで: よこの すきまを つめて 4れつ(64px の まま) */
@media (max-width: 374px) {
  .deco-bar { gap: 6px; padding-left: calc(6px + env(safe-area-inset-left)); padding-right: calc(6px + env(safe-area-inset-right)); }
}
/* とても 小さい スマホ(320 など): 11こ を 3だんに おさめる(ここだけ 56px) */
@media (max-width: 359px) {
  .tray { grid-template-columns: repeat(4, 56px); grid-auto-rows: 56px; gap: 5px; }
  .ditem svg { width: 44px; height: 44px; }
  .deco-done { width: 56px; min-height: 56px; }
  .deco-bar { gap: 6px; padding-left: calc(6px + env(safe-area-inset-left)); padding-right: calc(6px + env(safe-area-inset-right)); }
}
@media (min-width: 660px) { .tray { grid-template-columns: repeat(8, 64px); gap: 6px; } }
/* よこの 小さい スマホ(568×320 など): 56px に して 2だんで 画面の 4わり まで(11しゅ に なって 1だんには おさまらない。ここだけ 56px) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 659px) {
  .tray { grid-template-columns: repeat(8, 56px); grid-auto-rows: 56px; gap: 5px; }
  .ditem svg { width: 44px; height: 44px; }
  .deco-done { width: 56px; min-height: 56px; }
  .deco-bar { gap: 6px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
}
/* しゃしんの ひかり */
.flash { position: fixed; inset: 0; z-index: 20; background: #fff; pointer-events: none; opacity: 0; }
.flash.go { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
/* すむ ところ(よるの ボタンの した。寄る/ひく は 2本の ゆびで つまむ だけ・11/14 マスター) */
.hab-btn {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + 168px); right: calc(70px + env(safe-area-inset-right));
  width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: grid; place-items: center;
}
.hab-btn:active, .hcard:active { transform: translateY(3px); }
.hab-btn svg { width: 42px; height: 42px; }
.hi-w { fill: #4da3ff; } .hi-b { fill: #ff8a5c; } .hi-g { fill: #7ed957; } .hi-r { fill: #f6eef2; } .hi-p { fill: #ff9ad5; } .hi-y { fill: #ffd166; }
.hi-k { fill: #2b2433; } .hi-l { fill: none; stroke: #2b2433; stroke-width: 2.4; stroke-linecap: round; }
:is(.hab-btn, .hcard) svg :is(.hi-w, .hi-b, .hi-g, .hi-r, .hi-p, .hi-y) { stroke: #2b2433; stroke-width: 2.2; stroke-linejoin: round; }
.habs { gap: 2vh; justify-content: center; }
.habs .dir-top { position: absolute; left: calc(12px + env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top)); }
.hab-row { display: grid; grid-template-columns: repeat(2, minmax(120px, 170px)); gap: 14px; }
@media (orientation: landscape) { .hab-row { grid-template-columns: repeat(4, minmax(110px, 160px)); } }
.hcard {
  min-height: 132px; border-radius: 22px; background: var(--card); box-shadow: 0 6px 0 var(--card-sh);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 900; font-size: 20px; letter-spacing: .04em;
}
.hcard svg { width: 78px; height: 78px; }
.hcard[aria-pressed="true"] { box-shadow: 0 6px 0 var(--card-sh), 0 0 0 5px var(--gold); }
@media (orientation: landscape) and (max-height: 500px) { .hcard { min-height: 108px; } .hcard svg { width: 60px; height: 60px; } }
/* よる/あさ の ボタン(おとの ボタンの した) */
.night-btn {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + 92px); right: calc(70px + env(safe-area-inset-right));
  width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: grid; place-items: center;
}
.night-btn:active { transform: translateY(3px); }
.night-btn svg { width: 38px; height: 38px; }
.night-btn .moon { fill: #ffd84d; stroke: #2b2433; stroke-width: 2.5; stroke-linejoin: round; }
.night-btn .sun { fill: #ffb800; stroke: #e08a00; stroke-width: 3.5; stroke-linecap: round; }
.night-btn[aria-pressed="true"] .moon, .night-btn:not([aria-pressed="true"]) .sun { display: none; }

.food {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--food); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18); will-change: transform;
}
.bub {
  position: absolute; border-radius: 50%; border: 2px solid var(--bub); background: rgba(255, 255, 255, .16);
  animation: rise 2.4s ease-in both;
}
@keyframes rise {
  0% { transform: translate3d(0, 0, 0) scale(.5); opacity: 0; }
  12% { opacity: .95; }
  100% { transform: translate3d(8px, -150px, 0) scale(1.1); opacity: 0; }
}
.ripple {
  position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .85); animation: ring .6s ease-out forwards;
}
@keyframes ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* 上のボタン(下の 15% には置かない) */
.tank-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 10px calc(12px + env(safe-area-inset-left));
  pointer-events: none;
}
.tank-top > button { pointer-events: auto; flex-shrink: 0; }
.grow { flex: 1; }
.tbtn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 80px; min-width: 84px; padding: 4px 8px 6px; border-radius: 22px;
  font-weight: 900; font-size: 17px; letter-spacing: .06em; line-height: 1.1;
  background: var(--card); box-shadow: 0 5px 0 var(--card-sh);
}
.tbtn svg { width: 44px; height: 44px; }
.draw-btn { background: var(--pen); color: #fff; box-shadow: 0 5px 0 var(--pen-sh); }
.draw-btn:active { box-shadow: 0 2px 0 var(--pen-sh); }
.pc-body { fill: #ffd84d; }
.pc-tip { fill: #ffe9c4; }
.pc-line { fill: none; stroke: #2b2433; stroke-width: 3; stroke-linejoin: round; }
.jar { fill: #fff3d6; stroke: #2b2433; stroke-width: 3; }
.lid { fill: #ff7a59; stroke: #2b2433; stroke-width: 3; }
.pel { fill: #c4712c; }
.draw-btn.nudge { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge {
  0%, 68%, 100% { transform: none; }
  76% { transform: translateY(-6px) rotate(-3deg); }
  84% { transform: translateY(0) rotate(2deg); }
  91% { transform: translateY(-3px); }
}
.food-btn.shake { animation: jiggle .35s; }
@keyframes jiggle { 30% { transform: rotate(-8deg); } 65% { transform: rotate(6deg); } }
.snd {
  width: 64px; height: 64px; border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: grid; place-items: center;
}
.snd svg { width: 36px; height: 36px; }
.spk { fill: var(--ink); }
.wave, .slash { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.snd.off .wave, .snd:not(.off) .slash { display: none; }
/* おうちの人へ: 小さく・地味に(子どもが押したくなる見た目にしない) */
.parent-btn {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .32); color: var(--sub);
}
.parent-btn svg { width: 26px; height: 26px; fill: currentColor; fill-rule: evenodd; }
@media (prefers-color-scheme: dark) { .parent-btn { background: rgba(255, 255, 255, .08); } }
/* 320px のスマホでは 上の4つが入らない(おうちの人へ が右にはみ出す)ので、すき間と はばを つめる */
@media (max-width: 339px) {
  .tank-top { gap: 6px; }
  .tank-top .tbtn { min-width: 74px; padding: 4px 6px 6px; }
  .night-btn { right: calc(66px + env(safe-area-inset-right)); }
  .deco-bar { gap: 6px; padding-left: calc(8px + env(safe-area-inset-left)); padding-right: calc(8px + env(safe-area-inset-right)); }
}

/* =====================================================================
   なにを かく?
   ===================================================================== */
.pick {
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 15vh calc(12px + env(safe-area-inset-left));
}
.pick .top { display: flex; }
.pick-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.card {
  background: var(--card); border-radius: 22px; box-shadow: 0 6px 0 var(--card-sh);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.card.free { width: min(100%, 560px); min-height: 96px; flex-direction: row; gap: 10px; font-size: 24px; font-weight: 900; }
.card.free svg { width: 96px; height: 80px; }
.card.free .card-name { font-size: 24px; color: var(--ink); }
.paper { fill: #fffdf8; stroke: #b9c7d6; stroke-width: 3; }
.scrib { fill: none; stroke: #2e9bff; stroke-width: 6; stroke-linecap: round; }
.cray { fill: #ff4757; stroke: #2b2433; stroke-width: 3; stroke-linejoin: round; }
.cray-tip { fill: #ffe9c4; stroke: #2b2433; stroke-width: 3; stroke-linejoin: round; }
.nurie-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 560px); }
.tpl { aspect-ratio: 1; padding: 4px; min-width: 64px; overflow: hidden; }
.thumb { display: block; width: 80%; height: auto; aspect-ratio: 1; }
.card-name { font-size: 15px; font-weight: 800; color: var(--sub); line-height: 1.2; }

/* =====================================================================
   かく
   ===================================================================== */
.draw {
  display: grid; gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "pad" "kit";
  /* 画面の下 15% には押すものを置かない(手首が当たる) */
  padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 15vh calc(10px + env(safe-area-inset-left));
}
.draw-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pad-wrap { grid-area: pad; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.pad {
  position: relative; width: 300px; height: 300px; flex-shrink: 0;
  background: var(--paper); border-radius: 18px; box-shadow: 0 5px 0 var(--pad-sh);
  overflow: hidden; touch-action: none;
}
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pad-fx { position: absolute; inset: 0; pointer-events: none; }
.eyeg { position: absolute; display: block; transform: translate(-50%, -50%) scale(1.12); filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .25)); }
.eyeg svg { display: block; width: 100%; height: 100%; }
.pring { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 5px solid; animation: ring .45s ease-out forwards; }

/* 道具: 縦の画面は 5 列(いろ 4 列 + ふとさ/もどす) */
.kit {
  grid-area: kit; justify-self: center;
  display: grid; grid-template-columns: repeat(5, 64px); grid-auto-rows: 64px; grid-auto-flow: row dense;
  row-gap: 8px; column-gap: clamp(4px, calc((100vw - 340px) / 4), 10px);
}
.palette, .tools { display: contents; }
#thinBtn { grid-column: 5; grid-row: 1; }
#thickBtn { grid-column: 5; grid-row: 2; }
#eraserBtn { grid-column: 1; grid-row: 3; }
#eyeBtn { grid-column: 3; grid-row: 3; }
#undoBtn { grid-column: 4; grid-row: 3; }
#clearBtn { grid-column: 5; grid-row: 3; }
.draw.nurie #thinBtn, .draw.nurie #thickBtn, .draw.nurie #eraserBtn, .draw.nurie #eyeBtn { display: none; }
.draw.nurie #undoBtn { grid-column: 5; grid-row: 1; }
.draw.nurie #clearBtn { grid-column: 5; grid-row: 2; }
.sw {
  width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: grid; place-items: center;
}
.sw::before { content: ""; width: 44px; height: 44px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); transition: transform .12s; }
.sw[aria-checked="true"] { box-shadow: 0 4px 0 var(--card-sh), 0 0 0 4px var(--ink); }
.sw[aria-checked="true"]::before { transform: scale(1.18); }
@media (prefers-color-scheme: dark) { /* 夜でも くろが見えるように 紙の色の上に出す。えらんだ色は すき間をあけた わっか */
  .sw { background: var(--paper); }
  .sw[aria-checked="true"] { box-shadow: 0 4px 0 var(--card-sh), 0 0 0 3px var(--bg), 0 0 0 7px var(--ink); }
}
.tool {
  width: 64px; height: 64px; border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh);
  display: grid; place-items: center;
}
.tool svg { width: 40px; height: 40px; }
.tool[aria-pressed="true"] { box-shadow: 0 4px 0 var(--card-sh), 0 0 0 4px var(--ink); }
.tool.off { opacity: .45; }
.size .dot { display: block; border-radius: 50%; background: var(--dc, #2b2433); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--sub); }
#thinBtn .dot { width: 10px; height: 10px; }
#thickBtn .dot { width: 26px; height: 26px; }
.er1 { fill: #ff9fb5; }
.er2 { fill: #8fd3ff; }
.er-line { fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ar { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.bin { fill: #cfe3f2; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; }
.done {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 64px; min-width: 138px; padding: 0 18px 0 12px; border-radius: 20px;
  background: var(--gold); color: #3a2a00; box-shadow: 0 5px 0 var(--gold-sh);
  font-weight: 900; font-size: 24px;
}
.done svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.done.off { background: var(--card); color: var(--sub); box-shadow: 0 5px 0 var(--card-sh); }
.done.ready { animation: pop .45s ease-out; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.1); } 100% { transform: none; } }

/* 手のヒント(字が読めなくても わかるように) */
.hint { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -5px 0 0 -31px; pointer-events: none; z-index: 2; }
.hint svg { display: block; width: 100%; height: 100%; fill: #fff; stroke: #2b2433; stroke-width: 3.5; stroke-linejoin: round; }
.hint.free { animation: doodle 2.8s ease-in-out infinite; }
@keyframes doodle {
  0% { transform: translate(-70px, 10px); opacity: 0; }
  12% { opacity: 1; }
  35% { transform: translate(-20px, -40px); }
  60% { transform: translate(25px, 30px); }
  85% { transform: translate(70px, -10px); opacity: 1; }
  100% { transform: translate(70px, -10px); opacity: 0; }
}
.hint.nurie { animation: press 1.4s ease-in-out infinite; }
.hint.nurie::before {
  content: ""; position: absolute; left: -9px; top: -35px; width: 80px; height: 80px; border-radius: 50%;
  border: 5px solid var(--gold); animation: halo 1.4s ease-out infinite; opacity: 0;
}
@keyframes press { 0%, 100% { transform: translate(6px, 10px); } 45% { transform: translate(0, 0) scale(.94); } }
@keyframes halo { 0%, 40% { transform: scale(.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.hint.again { animation-duration: .9s; }

/* =====================================================================
   あたまは どっち? / おうちの人へ
   ===================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 10; background: var(--dim);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 15vh calc(12px + env(safe-area-inset-left));
}
.dir { gap: 1.5vh; }
.dir-top { align-self: stretch; display: flex; }
.dir-q { margin: 0; font-size: clamp(22px, 6vw, 32px); font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.dir-row { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.arrow {
  width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold); box-shadow: 0 6px 0 var(--gold-sh); color: #3a2a00;
  display: grid; place-items: center; animation: bob 1.4s ease-in-out infinite;
}
#dirR { animation-delay: -.7s; }
.arrow svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.dir-fish { flex: 1; min-width: 0; max-width: 380px; height: 100%; max-height: 320px; display: flex; align-items: center; justify-content: center; }
.dir-fish img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

.parent { justify-content: flex-start; }
.sheet {
  width: min(100%, 540px); margin-top: 1vh; padding: 16px;
  background: var(--card); color: var(--ink); border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  -webkit-user-select: text; user-select: text;
}
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.p-note { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--sub); }
.sheet.gating .p-note { display: none; }
.p-main { display: flex; flex-wrap: wrap; gap: 10px; }
.pbtn {
  min-height: 52px; padding: 0 16px; border-radius: 14px;
  background: var(--bg); border: 2px solid var(--card-sh); font-weight: 800; font-size: 16px;
}
.pbtn.danger { color: #d93848; border-color: #f0b3bb; }
@media (prefers-color-scheme: dark) { .pbtn.danger { color: #ff8e9b; border-color: #6b2d3a; } }
.gate-q { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.gate-q b { font-size: 22px; white-space: nowrap; }
.gate-q.shake { animation: sideways .3s; } /* 横長の文は まわさない(見出しに かさなる) */
@keyframes sideways { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 56px); gap: 8px; margin-bottom: 10px; }
.key { height: 52px; border-radius: 12px; background: var(--bg); border: 2px solid var(--card-sh); font-size: 22px; font-weight: 800; }
.p-done { margin: 6px 0 0; font-weight: 800; font-size: 18px; }

/* 320px のスマホ: 64px の5れつ(336px)が入らず 左右が切れるので、そこだけ 56px に */
@media (max-width: 339px) {
  .kit { grid-template-columns: repeat(5, 56px); grid-auto-rows: 56px; column-gap: 4px; }
  .sw, .tool { width: 56px; height: 56px; }
  .sw::before { width: 40px; height: 40px; }
  .tool svg { width: 36px; height: 36px; }
}

/* =====================================================================
   横の画面: かく は 左に いろ・まん中に紙・右に できた と道具。なにを かく? は横にならべる
   ===================================================================== */
@media (orientation: landscape) {
  .draw {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "back pad done" "pal pad tools";
    column-gap: 14px;
  }
  .draw-top, .kit { display: contents; }
  #drawBack { grid-area: back; justify-self: start; }
  #doneBtn { grid-area: done; }
  .palette { grid-area: pal; display: grid; grid-template-columns: repeat(3, 64px); grid-auto-rows: 64px; gap: 8px; align-self: start; }
  .tools { grid-area: tools; display: grid; grid-template-columns: repeat(2, 64px); grid-auto-rows: 64px; gap: 8px; align-self: start; justify-self: center; }
  #thinBtn, #thickBtn, #eraserBtn, #eyeBtn, #undoBtn, #clearBtn,
  .draw.nurie #undoBtn, .draw.nurie #clearBtn { grid-column: auto; grid-row: auto; }
  .pick-body { flex-direction: row; align-items: center; }
  .card.free { width: auto; min-width: 150px; align-self: stretch; max-height: 360px; flex-direction: column; padding: 10px 14px; }
  .nurie-grid { width: auto; grid-template-columns: repeat(3, min(150px, calc((85vh - 120px) / 3))); }
}
@media (orientation: landscape) and (max-height: 600px) {
  .keypad { grid-template-columns: repeat(9, 50px); gap: 6px; }
  .p-note { font-size: 13px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .weed, .bubbler i, .draw-btn.nudge, .arrow, .dir-fish img, .hint, .fish.float .fbody, .flw, .swim.land .fish.walk .whole, .food-btn.shake, .gate-q.shake, .flash.go, .tray.shake, .dc .bob { animation: none !important; }
  .fish.swim .tail { animation-duration: 1.6s !important; }
}
