/* いいかげん — 色は palette.js と同じ（お風呂らしいアクアとコーラル）・Mochiy Pop One。部品は paguon-toy.css */
:root {
  color-scheme: light;
  --pg-bg: #FFF9F0;
  --pg-panel: #FDFBF7;
  --pg-ink: #3F3844;
  --pg-shu: #FF8F7E;
  --pg-line: #DCD6D4;
  --pg-sub: #6C6570;
  --pg-font: 'Mochiy Pop One', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
  --butter: #FFD36B;
  --pink: #FF8F7E;
  --sage: #7CCFE0;
  --sb: max(env(safe-area-inset-bottom), var(--vb, 0px));
  --scene: #EDEFE9;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-synthesis: none; }
html, body { margin: 0; height: 100%; height: 100dvh; background: var(--pg-bg); color: var(--pg-ink); overflow: hidden; overscroll-behavior: none;
  font-family: var(--pg-font); font-weight: 400; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#app { position: relative; height: 100%; overflow: hidden; touch-action: none; background: var(--scene); transition: background .6s; }
[hidden] { display: none !important; }
.pg-btn, .pg-title, .card, .pop, #say { font-weight: 400; }
.pg-btn.shu { color: var(--pg-ink); } /* Soft Pink の上の文字は白でなく Warm Charcoal */
.pg-goal-label { color: var(--pg-ink); }
.fx-c, .fx-j { display: inline-block; }

#stage { position: absolute; inset: 0; touch-action: none; }

/* 上：ワイプの顔（3Dは canvas に描く。ここは枠だけ）・セリフ・何杯目か */
#wipe { position: absolute; left: 8px; top: calc(8px + env(safe-area-inset-top)); width: clamp(92px, 28vw, 116px); aspect-ratio: 1; border: 5px solid var(--pg-panel); border-radius: 12px; box-shadow: 0 4px 0 rgba(71,64,74,.2); z-index: 3; pointer-events: none; }
#say { position: absolute; left: calc(8px + clamp(92px, 28vw, 116px) + 12px); right: 8px; top: calc(46px + env(safe-area-inset-top)); z-index: 3; pointer-events: none; display: flex; }
#say > div { position: relative; background: var(--pg-panel); border-radius: 14px; padding: 6px 12px 8px; font-size: 16px; line-height: 1.35; box-shadow: 0 3px 0 rgba(71,64,74,.18); }
#say > div::before { content: ''; position: absolute; left: -8px; top: 14px; border-right: 9px solid var(--bub, var(--pg-panel)); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
#say .memo { font-size: 22px; white-space: nowrap; padding: 4px 12px 6px; }
#say .memo small { font-size: 14px; }
#say .good { background: var(--butter); --bub: var(--butter); font-size: 20px; }
#say .bad { background: var(--pink); --bub: var(--pink); font-size: 20px; }
#say .in { animation: memo-in .22s ease-out; }
@keyframes memo-in { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
#cups { position: absolute; right: 8px; top: calc(8px + env(safe-area-inset-top)); display: flex; gap: 5px; background: var(--pg-panel); border-radius: 14px; padding: 8px 10px; box-shadow: 0 3px 0 rgba(71,64,74,.18); z-index: 3; pointer-events: none; }
#cups i { width: 12px; height: 12px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2.5px #DCD6D4; }
#cups i.done { background: var(--sage); box-shadow: none; }
#cups i.now { background: var(--butter); box-shadow: none; transform: scale(1.2); }

/* 下：蛇口のボタン。最下部（Android の X で隠れる64px）より上に置く */
#pad { position: absolute; left: 0; right: 0; bottom: calc(var(--sb) + 64px + 2vh); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 4; pointer-events: none; }
#pad .row { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 5vw, 30px); }
/* どうぞ：下のボタン群のすぐ上。お湯が少しもない時は押せない（場所は空けたまま） */
#pad #bServe { pointer-events: auto; font-size: 20px; padding: 9px 34px; transition: opacity .15s, transform .15s; }
#pad #bServe.off { opacity: 0; pointer-events: none; transform: translateY(6px) scale(.9); }
#pad button { pointer-events: auto; font-family: var(--pg-font); font-weight: 400; color: var(--pg-ink); border: 0; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tap { width: clamp(92px, 29vw, 120px); height: clamp(92px, 29vw, 120px); border-radius: 50%; font-size: 24px; box-shadow: 0 7px 0 rgba(71,64,74,.32); transition: transform .05s, box-shadow .05s; }
.tap { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.tap small { font-size: 16px; margin-top: 4px; background: var(--pg-panel); border-radius: 10px; padding: 1px 8px 3px; }
.tap small:empty { display: none; }
.tap.hot { background: var(--pink); }
.tap.cold { background: var(--sage); }
.tap.on { transform: translateY(7px) scale(calc(.97 - var(--force, 0) * .06)); box-shadow: 0 0 0 rgba(71,64,74,.32), 0 0 0 calc(var(--force, 0) * 8px) rgba(71,64,74,.14); }
.hand { width: 62px; height: 62px; border-radius: 50%; background: var(--pg-panel); font-size: 22px; box-shadow: 0 5px 0 rgba(71,64,74,.25); align-self: flex-end; margin-bottom: 4px; }
.hand:active { transform: translateY(5px); box-shadow: none; }
.hand.used { visibility: hidden; }

/* ふきだし（使っていない） */
@keyframes bub-in { 0% { transform: translate(-50%, -100%) scale(.5); opacity: 0; } 60% { transform: translate(-50%, -100%) scale(1.08); opacity: 1; } 100% { transform: translate(-50%, -100%) scale(1); } }

/* ぴょこぴょこ文字 */
#pops { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: 24px; color: var(--pg-ink); text-align: center; line-height: 1.15;
  text-shadow: 0 3px 0 var(--pg-bg), 0 -3px 0 var(--pg-bg), 3px 0 0 var(--pg-bg), -3px 0 0 var(--pg-bg), 2px 2px 0 var(--pg-bg), -2px -2px 0 var(--pg-bg), 2px -2px 0 var(--pg-bg), -2px 2px 0 var(--pg-bg); }
.pop.big { font-size: 46px; }
.pop.mid { font-size: 30px; }
.pop.declare { font-size: 52px; }
.pop.bonus { font-size: 22px; background: var(--butter); border-radius: 12px; padding: 3px 12px 5px; text-shadow: none; }
.pop small { font-size: .55em; }
.pop.bad { color: #D9604F; }
@media (max-width: 340px) { .pop.big { font-size: 38px; } .pop.declare { font-size: 44px; } #say > div { font-size: 15px; } #say .memo { font-size: 19px; } }

/* 重ねる画面 */
.ov { position: absolute; inset: 0; display: none; z-index: 8; pointer-events: none; }
.ov.show { display: block; }
.ov button { pointer-events: auto; }

/* タイトル：ボタンは見出しのすぐ下（画面の下には置かない） */
#ovTitle.show { display: flex; flex-direction: column; align-items: flex-start; padding: calc(18px + env(safe-area-inset-top)) 18px 16px; }
#ovTitle .pg-title { font-size: clamp(40px, 13vw, 64px); font-weight: 400; text-shadow: 0 3px 0 var(--pg-bg), 0 -3px 0 var(--pg-bg), 3px 0 0 var(--pg-bg), -3px 0 0 var(--pg-bg), 3px 3px 0 var(--pg-bg), -3px -3px 0 var(--pg-bg), 3px -3px 0 var(--pg-bg), -3px 3px 0 var(--pg-bg); }
.tLead { margin: 8px 0 0; font-size: 15px; background: var(--pg-panel); border-radius: 10px; padding: 3px 10px; }
.tFoot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: clamp(12px, 2.5vh, 26px); }
.pg-btn.big { font-size: 22px; padding: 13px 30px; }
.pg-btn.small { font-size: 15px; padding: 8px 14px; }
.tBest { margin: 12px 0 0; font-size: 13px; line-height: 1.6; background: var(--pg-panel); border-radius: 10px; padding: 3px 10px; }
.tBest:empty { display: none; }
.tSign { position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); }

/* 結果（1杯ごと）：上寄せ。温度計の針 → 点の内わけ → 合計 → ハンコ。ボタンは上、広告はその下 */
#ovResult.show { display: flex; justify-content: center; align-items: flex-start; padding: calc(env(safe-area-inset-top) + 12px) 0 calc(var(--sb) + 80px); background: rgba(255,249,240,.5); overflow-y: auto; }
#ovResult .card { pointer-events: auto; background: var(--pg-panel); border-radius: 22px; padding: 12px 16px 14px; text-align: center; box-shadow: 0 5px 0 rgba(63,56,68,.22); width: min(100% - 16px, 340px); animation: card-in .32s cubic-bezier(.2,1.4,.4,1); }
@keyframes card-in { from { transform: translateY(60px) scale(.92); opacity: 0; } }
.rTub { margin: 0; font-size: 15px; display: inline-block; background: var(--pg-bg); border-radius: 10px; padding: 2px 12px 4px; }
.rThermo { position: relative; height: 22px; margin: 16px 6px 6px; border-radius: 11px; background: linear-gradient(90deg, #4F86E8, #7CCFE0 38%, #D8F1F6 42%, #FFC4B8 70%, #FF8F7E); }
.rThermo .band { position: absolute; top: -5px; bottom: -5px; border-radius: 8px; box-shadow: 0 0 0 3px var(--pg-ink) inset; background: rgba(255,211,107,.45); }
.rThermo .tick { position: absolute; top: -9px; width: 3px; height: 40px; margin-left: -1.5px; background: var(--pg-ink); border-radius: 2px; }
.rThermo i { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--pg-panel); box-shadow: 0 0 0 4px var(--pg-ink), 0 3px 0 4px rgba(63,56,68,.25); }
.rThermo i.in { background: var(--butter); animation: needle-in .35s ease-out; }
@keyframes needle-in { 50% { transform: scale(1.5); } }
.rTemp { margin: 10px 0 0; display: flex; align-items: baseline; justify-content: center; gap: 2px; font-size: 14px; }
.rTemp b { font-size: 40px; font-variant-numeric: tabular-nums; line-height: 1; }
.rTemp small { font-size: 18px; }
.rChips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 30px; margin-top: 10px; }
.rChips .chip { font-size: 13px; background: var(--pg-bg); border-radius: 12px; padding: 3px 10px 5px; animation: chip-in .25s cubic-bezier(.2,1.6,.4,1); white-space: nowrap; }
.rChips .chip b { font-size: 16px; margin-left: 4px; }
.rChips .chip.full { background: var(--butter); }
.rChips .chip.bad { background: var(--pink); }
.rChips .chip.dim { opacity: .75; }
@keyframes chip-in { from { transform: scale(.3) translateY(10px); opacity: 0; } }
.rScoreRow { position: relative; margin-top: 6px; }
.rScore { margin: 0; line-height: 1; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.rScore b { font-size: 64px; font-variant-numeric: tabular-nums; }
.rScore small { font-size: 22px; }
.rStamp { position: absolute; right: -4px; top: 14px; font-size: 22px; padding: 6px 12px 8px; border-radius: 14px; background: var(--pg-panel); box-shadow: 0 0 0 3px var(--pg-ink); transform: rotate(-12deg) scale(0); opacity: 0; white-space: nowrap; }
.rStamp.on { animation: stamp .42s cubic-bezier(.3,1.6,.5,1) forwards; }
.rStamp.just { background: var(--butter); }
.rStamp.hot, .rStamp.over { background: var(--pink); }
.rStamp.cold { background: #9CC1F5; }
@keyframes stamp { 0% { transform: rotate(-12deg) scale(2.6); opacity: 0; } 60% { transform: rotate(-12deg) scale(.9); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); opacity: 1; } }
#rCard.done { animation: card-thud .3s ease-out; }
@keyframes card-thud { 30% { transform: translateY(5px); } }
.rBest { margin: 8px 0 0; font-size: 13px; min-height: 1.2em; }
.rBtns { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.rBtns #bAgain { font-size: 20px; padding: 11px 30px; }
.rSub { display: flex; gap: 10px; }
#ovResult .rAd { margin: 16px -16px 0; }

/* 共有できない時：画像を保存して X をひらく */
#ovSave.show { display: flex; justify-content: center; align-items: flex-start; padding-top: calc(env(safe-area-inset-top) + 6vh); background: rgba(255,249,240,.65); z-index: 9; }
.saveCard { pointer-events: auto; background: var(--pg-panel); border-radius: 22px; padding: 14px 16px 16px; text-align: center; box-shadow: 0 5px 0 rgba(63,56,68,.22); width: min(100% - 24px, 360px); }
.saveWhy { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.saveCard img { width: 62%; border-radius: 12px; display: block; margin: 0 auto; }
.saveBtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* 紙ふぶき・ゆれ */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.conf { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: conf linear forwards; }
@keyframes conf { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
#app.shake { animation: shake .45s; }
@keyframes shake { 15% { transform: translate(-8px, 2px); } 30% { transform: translate(7px, -3px); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -1px); } 80% { transform: translate(-2px, 0); } }
@media (prefers-reduced-motion: reduce) { #app.shake { animation: none; } .conf { display: none; } }

/* 触っている所の白い丸（タッチの見える化。指ごとに1つ） */
.touch-dot { position: fixed; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,.35); box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 2px 6px rgba(71,64,74,.25); pointer-events: none; z-index: 50; animation: touch-in .12s ease-out; }
.touch-dot.out { animation: touch-out .18s ease-in forwards; }
@keyframes touch-in { from { transform: scale(.4); opacity: 0; } }
@keyframes touch-out { to { transform: scale(1.4); opacity: 0; } }

/* 結果画面の広告（/paguon-ads.js、300×250）。「もう一回」のボタンの下に、間をあけて置く（画面の最下部には置かない） */
#ovResult { overflow-y: auto; }
#ovResult .rAd { margin: 16px -14px 0; }
#ovResult .card:has(> .rAd:not([hidden])) { width: min(100% - 16px, 332px); }
