/* ページの動きを止める。スクロール、拡大、引っ張って更新、選択、長押しのメニューを出さない */
html, body { margin: 0; position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; color: #2a2a2a;
  background: repeating-linear-gradient(90deg, #151a26 0 14px, #1a2030 14px 28px);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; touch-action: none; cursor: pointer; }
:root { --red: #d7261e; --yellow: #ffd400; --paper: #fbf3dc; --wood: #b98a56; --ceil: #26324a; }
#app { position: relative; margin: 0 auto; width: min(100vw, 430px); height: min(100dvh, 900px); display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(#26324a 0, #26324a 52px, #3b2f28 52px, #2a211c 100%); box-shadow: 0 0 40px rgba(0,0,0,.6); }
@media (min-width: 440px) { #app { margin-top: max(0px, calc((100dvh - 900px) / 2)); border-radius: 10px; } }

/* 天井: 蛍光灯、店の看板、閉店までの時計、音と言語 */
#hud { position: relative; flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; color: #f4fbff; z-index: 8;
  background: linear-gradient(#1b2438, #2b3a58); border-bottom: 3px solid #121826; }
.lights { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: space-around; padding: 0 14px; pointer-events: none; }
.lights i { width: 54px; height: 5px; margin-top: 2px; border-radius: 0 0 4px 4px; background: #f4fbff; box-shadow: 0 0 10px 3px rgba(244,251,255,.55), 0 6px 18px 4px rgba(244,251,255,.14); animation: flick 7s infinite; }
.lights i:nth-child(3) { animation-delay: -3s; opacity: .85; }
@keyframes flick { 0%, 93%, 97%, 100% { opacity: 1; } 95% { opacity: .55; } }
.sign { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 6px; background: var(--red); border: 2px solid var(--yellow); box-shadow: 0 2px 0 #7a0d08; transform: rotate(-1.5deg); transform-origin: 20% 0; animation: swing 6s ease-in-out infinite; min-width: 0; }
@keyframes swing { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1deg); } }
.sign .mark { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--red); font-weight: 900; font-size: 15px; display: grid; place-items: center; border: 2px solid var(--red); outline: 1.5px solid #fff; flex: none; }
.sign .sname { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.sign b { font-size: 14px; font-weight: 900; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.sign small { font-size: 9px; color: var(--yellow); font-weight: 800; white-space: nowrap; }
#clock { font: 700 24px/1 ui-monospace, Menlo, "Courier New", monospace; letter-spacing: 1px; color: #ffe27a; padding: 4px 8px; background: #0e1320; border-radius: 4px; border: 1px solid #455272; text-shadow: 0 0 6px rgba(255,214,90,.7); }
#clock.late { color: #ff6b5e; text-shadow: 0 0 8px rgba(255,80,60,.8); animation: blink 1s steps(2) infinite; font-weight: 900; }
@keyframes blink { 50% { opacity: .45; } }
.hud-btns { display: flex; gap: 6px; }
.hud-btns button { height: 36px; min-width: 40px; border: 0; border-radius: 8px; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 800; padding: 0 8px; display: grid; place-items: center; }
.hud-btns button svg { width: 22px; height: 22px; }
.hud-btns button:active { background: rgba(255,255,255,.3); }
#snd.off { opacity: .45; }
#snd.off::after { content: ""; position: absolute; width: 26px; height: 2px; background: #fff; transform: rotate(45deg); }
.bunting { position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, var(--red) 25%, transparent 25%) 0 0 / 22px 12px, linear-gradient(225deg, var(--yellow) 25%, transparent 25%) 11px 0 / 22px 12px; opacity: .92; }

/* 下の帯: 予算、カゴ */
#bar { flex: none; height: 132px; display: flex; align-items: center; gap: 10px; padding: 8px 56px 8px 10px; color: #fff; position: relative; z-index: 6;
  background: repeating-linear-gradient(90deg, #4d5a55 0 38px, #56655f 38px 40px), #4d5a55; border-top: 6px solid #2b3330; box-shadow: inset 0 14px 18px -10px rgba(0,0,0,.5); }
#budget { font-weight: 900; font-size: 20px; min-width: 112px; line-height: 1.1; padding: 6px 8px 6px 34px; background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 22'%3E%3Crect x='1' y='3' width='26' height='17' rx='4' fill='%23b9854a'/%3E%3Crect x='1' y='3' width='26' height='6' rx='3' fill='%23d6a566'/%3E%3Crect x='18' y='10' width='9' height='6' rx='2' fill='%238a5b2c'/%3E%3Ccircle cx='21.5' cy='13' r='1.4' fill='%23ffd400'/%3E%3C/svg%3E") 6px 50% / 22px 18px no-repeat; border-radius: 8px; text-shadow: 0 1px 2px #000; }
#budget[data-warn="1"] { color: #ffb4a8; }
#basket { flex: 1; align-self: stretch; margin: 2px 0; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-end; padding: 6px 6px 8px; overflow: hidden; position: relative;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 7px), repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 7px), #a5743d; border-radius: 4px 4px 12px 12px; border: 3px solid #7d5428; box-shadow: inset 0 3px 6px rgba(0,0,0,.35); }
#basket::before { content: ""; position: absolute; left: 18%; right: 18%; top: -14px; height: 14px; border: 3px solid #7d5428; border-bottom: 0; border-radius: 14px 14px 0 0; }
#basket i { display: block; width: 40px; height: 36px; border-radius: 6px; position: relative; animation: drop .35s cubic-bezier(.3, 1.6, .5, 1); }
#basket i svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
#basket i[data-more]::after { content: attr(data-more); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.65); border-radius: 6px; color: #fff; font-size: 13px; font-weight: 800; }
@keyframes drop { from { transform: translateY(-16px) scale(1.15); } }
#hint { display: none !important; }
#left { flex: none; width: 160px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#budget { min-width: 0 !important; white-space: nowrap; font-size: 18px !important; padding-right: 4px !important; }
.tut, .announce { text-wrap: balance; }
#goal { display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.2; font-weight: 700; color: #f3f1e6; text-shadow: 0 1px 2px #000; }
#goal b { color: var(--yellow); font-weight: 900; } #goal span { color: #e0ddd0; font-size: 10.5px; }
/* 手ほどきの文と放送は、棚の外（下のカゴの帯の中）に出す。棚の升、値札、「カゴへ」、「取り消す」を隠さない */
.tut, .announce { position: absolute; left: 180px; right: 60px; top: 7px; bottom: 7px; z-index: 30; pointer-events: none; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; font-size: 14px; line-height: 1.25; color: #2a2a2a; background: var(--yellow); padding: 4px 8px; border-radius: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.35); animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.announce { z-index: 31; background: #fff; text-align: left; justify-content: flex-start; padding: 4px 8px 4px 34px; font-size: 13px; }
.announce { background-color: #fff;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l6-5v16l-6-5H3z' fill='%23d7261e'/%3E%3Cpath d='M16 8a5 5 0 0 1 0 8' fill='none' stroke='%23d7261e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10px 50% / 22px 22px no-repeat; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.flyer { position: absolute; z-index: 40; pointer-events: none; }
.flyer svg { width: 100%; height: 100%; }
[hidden] { display: none !important; }
@media (max-height: 700px) { #hud { height: 40px; } .lights i { width: 44px; } #bar { height: 96px; padding-top: 4px; padding-bottom: 4px; } #clock { font-size: 20px; padding: 3px 6px; } #budget { font-size: 17px; min-width: 100px; padding-left: 32px; } .tut, .announce { top: 5px; bottom: 5px; font-size: 12.5px; } #left { width: 154px; gap: 2px; } #goal { font-size: 10px; line-height: 1.15; } #goal span { font-size: 10px; }
  #app { background: linear-gradient(#26324a 0, #26324a 40px, #3b2f28 40px, #2a211c 100%); } .sign b { font-size: 12px; } .sign .mark { width: 20px; height: 20px; font-size: 12px; } .sign small { display: none; } .hud-btns button { height: 30px; } #basket i { width: 32px; height: 28px; } .bunting { height: 9px; bottom: -9px; } }
@media (max-width: 370px) { .sign small { display: none; } .sign b { font-size: 12px; } #clock { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .sign, .lights i { animation: none; } }
/* 手ほどきは、カゴの上の細い吹き出し（カゴには重ねない）。15秒操作がなければ「?」に畳む */
#bar[data-tut="1"] #basket, #bar[data-tut="1"] #left { margin-top: 26px; }
.tut { left: 8px; right: 58px; top: 3px; bottom: auto; height: 22px; padding: 0 10px; font-size: 12px; line-height: 1.1; border-radius: 11px; white-space: nowrap; overflow: hidden; text-wrap: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.tut::after { content: ""; position: absolute; left: 22px; bottom: -5px; border: 5px solid transparent; border-top-color: var(--yellow); border-bottom: 0; }
.tut.mini { left: auto; right: 62px; width: 24px; padding: 0; font-size: 0; justify-content: center; }
.tut.mini::before { content: "?"; font-size: 14px; font-weight: 900; }
.tut.mini::after { left: 8px; }
@media (max-height: 700px) { #bar[data-tut="1"] #basket { margin-top: 22px; } .tut { top: 2px; height: 20px; font-size: 11px; } }
@media (max-width: 370px) { .tut { left: 6px; right: 54px; font-size: 11px; padding: 0 6px; } }
@media (max-height: 700px) { #bar[data-tut="1"] #left { margin-top: 22px; } #bar[data-tut="1"] #goalRule { display: none; } }
/* 周回3: 閉店の時刻（時計の下の小さな字） */
#hud #closeAt { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); font: 800 9px/1 system-ui, sans-serif; color: #f3d68a; letter-spacing: .3px; text-shadow: 0 1px 2px #000; white-space: nowrap; pointer-events: none; z-index: 9; }
#hud #clock { margin-bottom: 7px; }
#basket i { width: 46px; height: 42px; }
@media (max-height: 700px) { #basket i { width: 36px; height: 32px; } }
