* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #f5f3ee; color: #1b1b1d; touch-action: manipulation;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#app { touch-action: manipulation; position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); }

#stage { position: relative; flex: 1; min-height: 150px; }
#c, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { pointer-events: none; }
/* 料理名: 料理の上に、止まりきったら出る */
#named { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; pointer-events: none; animation: pop .3s cubic-bezier(.2,1.6,.4,1) both; }
#named[hidden] { display: none; }
#named b { display: inline-block; background: #fff; border: 2.5px solid #1b1b1d; padding: 3px 12px; font-size: clamp(17px, 5.4vw, 24px); line-height: 1.3; max-width: 100%; }
#named span { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; -webkit-text-stroke: 4px #f5f3ee; paint-order: stroke; }
#named i { position: absolute; right: 6px; top: -46px; color: #d23a2c; border: 3px double #d23a2c; padding: 2px 8px; font-style: normal; font-weight: 900; font-size: 18px;
  transform: rotate(-10deg); background: rgba(255,255,255,.85); animation: hanko .35s cubic-bezier(.2,1.6,.4,1) .3s both; }
#named i[hidden] { display: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes hanko { from { transform: rotate(-10deg) scale(2.4); opacity: 0; } }

/* 4本のリール */
#reels { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.reel { position: relative; }
.reel small { display: block; text-align: center; font-size: 11px; font-weight: 700; color: #45433e; margin-bottom: 2px; }
.win { position: relative; height: 120px; overflow: hidden; background: #fff; border: 2.5px solid #1b1b1d; }
.win::before, .win::after { content: ''; position: absolute; left: 0; right: 0; height: 40px; z-index: 2; pointer-events: none; background: rgba(245,243,238,.62); }
.win::before { top: 0; border-bottom: 1.5px solid #1b1b1d; }
.win::after { bottom: 0; border-top: 1.5px solid #1b1b1d; }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.strip div { height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.1; padding: 0 2px; word-break: keep-all; overflow-wrap: anywhere; }
.strip div.long { font-size: 11px; }
.strip div.rare { color: #a8761a; }
.reel.done .win { border-color: #1b1b1d; }
.reel.next .win { outline: 3px solid #f2c230; outline-offset: 1px; }
.reel.gold .win { border-color: #c8961e; outline: 3px solid #e8c04a; outline-offset: 1px; }

#stop { flex: none; margin-top: 10px; width: 100%; padding: 14px; font-size: 20px; letter-spacing: 4px; }
#stop:disabled { background: #a9a59b; border-color: #a9a59b; }

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(245,243,238,.86); overflow-y: auto; overscroll-behavior: contain; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
#title { background: rgba(245,243,238,.97); }
.box { width: 100%; max-width: 360px; text-align: center; margin: auto; }
.box.wide { max-width: 520px; }
#tart { width: 100%; height: clamp(150px, 30vh, 240px); display: block; margin: 0 auto 6px; }
h1 { font-size: 60px; letter-spacing: 8px; margin: 0 0 4px; -webkit-text-stroke: 8px #f5f3ee; paint-order: stroke; }
.sub { margin: 0 0 26px; font-size: 16px; font-weight: 700; }
button, .button { font: inherit; font-size: 16px; font-weight: 700; color: #1b1b1d; background: #fff; border: 2px solid #1b1b1d; border-radius: 0;
  padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
button.primary, .button.primary { background: #1b1b1d; color: #fff; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 12px; }
.big { font-size: 20px; font-weight: 700; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.row > * { flex: 1; }
#r-post { flex: 1.7; background: #1b1b1d; color: #fff; font-size: 18px; padding: 13px 8px; white-space: nowrap; }
#r-post svg { width: 18px; height: 18px; }
#r-img, #again { flex: 1; font-size: 13.5px; padding: 10px 4px; white-space: nowrap; }
#r-after { margin-top: 18px; }
/* ポストの行は結果の最後に置いて、下に貼りつける（ルスバンと同じ） */
#r-share { gap: 6px; position: sticky; bottom: 0; z-index: 3; margin: 14px -12px 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #f5f3ee; box-shadow: 0 -8px 10px -8px rgba(27,27,29,.28); }
#result { background: #f5f3ee; padding: 10px 12px 0; align-items: flex-start; overflow-x: hidden; }
#result .box { padding-bottom: 0; min-height: 100%; display: flex; flex-direction: column; }
#result #r-after { margin-bottom: auto; }
button.link { background: none; border: 0; padding: 4px; font-size: 14px; text-decoration: underline; color: #45433e; }
.zk { margin: 10px 0 0; display: flex; justify-content: center; align-items: center; gap: 8px; }
.new { color: #d23a2c; font-weight: 700; font-size: 13px; }

#r-row .sn-row { flex-wrap: nowrap; overflow: hidden; justify-content: center; gap: 3px; margin-top: 10px; max-width: none; font-size: 12.5px; }
#r-row .sn-row > span { flex: none; font-size: 10.5px; }
#r-row .sn-chip { flex: none; gap: 3px; padding: 4px 6px 4px 3px; white-space: nowrap; }
#r-row .sn-chip:last-child { flex: 0 1 auto; min-width: 0; }
#r-row .sn-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#r-row .sn-chip img { flex: none; width: 20px; height: 20px; }

/* お品書き */
#sheet { background: #fbfaf6; border: 3px solid #1b1b1d; outline: 1px solid #1b1b1d; outline-offset: -7px; padding: 12px 16px 12px; text-align: center; position: relative; }
.m-head { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 6px; border-bottom: 2px solid #1b1b1d; padding-bottom: 4px; }
.m-pic { position: relative; }
#r-dish { width: 100%; height: clamp(170px, 32vh, 280px); display: block; margin: 6px 0 2px; }
#r-name { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
#r-name.long { font-size: 21px; }
#r-sub { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #45433e; }
.m-nums { margin: 8px 0 0; display: flex; justify-content: center; align-items: baseline; gap: 14px; font-variant-numeric: tabular-nums; }
.m-nums b { font-size: 26px; color: #d23a2c; }
.m-nums span { font-size: 18px; font-weight: 700; }
.m-parts { margin: 4px 0 0; font-size: 11.5px; color: #6f6c64; }
.m-rev { margin-top: 8px; border-top: 2px solid #1b1b1d; padding-top: 6px; text-align: left; }
.m-rev p { margin: 0; }
#r-stars { color: #e0a020; font-size: 17px; letter-spacing: 1px; }
#r-score { margin-left: 6px; font-size: 17px; }
#r-review { font-size: 16px; font-weight: 700; line-height: 1.4; margin-top: 2px !important; }
@media (max-height: 640px) {
  #r-dish { height: 150px; }
  #r-name { font-size: 22px; }
}

#zukan { z-index: 20; background: #f5f3ee; align-items: flex-start; }
#z-list { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; text-align: center; font-size: 12px; }
#z-list li { border: 2px solid #1b1b1d; background: #fff; padding: 4px; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#z-list li.gold { border-color: #d9a520; }
#z-list li canvas { width: 56px; height: 56px; }
#z-list li b { display: block; font-size: 11.5px; line-height: 1.25; }
#z-list li.no { border: 2px dashed #a9a59b; color: #a9a59b; background: transparent; font-size: 22px; font-weight: 700; }
#z-list h3 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 13px; text-align: left; }
#c.bump { animation: bump .22s ease-out; }
@keyframes bump { 40% { transform: scale(1.04); } }
/* 食材が合ったとき: 少し大きく弾む */
#c.bump2 { animation: bump2 .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes bump2 { 35% { transform: scale(1.08); } }

/* お客さんの注文 */
#order { flex: none; margin: 8px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; animation: pop .3s cubic-bezier(.2,1.6,.4,1) both; }
#order small { flex-basis: 100%; text-align: center; font-size: 12px; font-weight: 700; color: #45433e; }
#order span { font-size: 12px; font-weight: 700; background: #1b1b1d; color: #fff; padding: 2px 8px; }
#order b { font-size: 20px; border-bottom: 3px solid #d23a2c; line-height: 1.3; }
.m-order { margin: 6px 0 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.m-order span { font-size: 11px; font-weight: 700; background: #1b1b1d; color: #fff; padding: 1px 7px; align-self: center; }
.m-order b { font-size: 18px; }
.m-order small { font-size: 12px; font-weight: 700; color: #6f6c64; }
#r-ok { position: absolute; left: 4px; bottom: 6px; font-style: normal; font-weight: 900; font-size: 17px; padding: 3px 9px; border: 3px solid; transform: rotate(-8deg);
  background: rgba(255,255,255,.88); animation: hanko .35s cubic-bezier(.2,1.6,.4,1) .45s both; }
#r-ok.yes { color: #d23a2c; border-color: #d23a2c; }
#r-ok.no { color: #45433e; border-color: #45433e; border-style: dashed; }
/* 実在する料理: 注文のはんこの上に1行（はんこは1つにまとめる） */
#r-ok small { display: block; text-align: center; font-size: 20px; line-height: 1.1; color: #d23a2c; letter-spacing: 4px; border-bottom: 2px solid currentColor; margin-bottom: 2px; }
#r-ok.no small { border-bottom-color: #45433e; }
#r-who { font-size: 12px; font-weight: 700; color: #6f6c64; text-align: right; margin-top: 2px !important; }
@media (max-height: 640px) {
  #order { margin-top: 4px; }
  #order small { display: none; }
}

/* 言語（src/lang.js）。日本語以外は表が読めるまで隠す */
html.lang-wait #app, html.lang-wait .panel { visibility: hidden; }
.langsw { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; padding: 5px 10px; border: 1.5px solid #1b1b1d; border-radius: 99px; font-size: 13px; font-weight: 800; }
.langsw svg { width: 15px; height: 15px; }
.langsw select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
:lang(ko) body { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif; }
:lang(zh-Hans) body { font-family: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
:lang(zh-Hant) body { font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; }
:lang(en) body, :lang(es) body, :lang(pt) body, :lang(fr) body, :lang(de) body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
/* 横書きの長い言葉: 題名・リールの段・料理名・はんこ・ボタンを詰める */
:lang(en) h1, :lang(es) h1, :lang(pt) h1, :lang(fr) h1, :lang(de) h1, :lang(ko) h1 { font-size: 48px; letter-spacing: 1px; }
:lang(en) .strip div, :lang(es) .strip div, :lang(pt) .strip div, :lang(fr) .strip div, :lang(de) .strip div { font-size: 12px; line-height: 1.05; hyphens: auto; }
:lang(en) .strip div.long, :lang(es) .strip div.long, :lang(pt) .strip div.long, :lang(fr) .strip div.long, :lang(de) .strip div.long { font-size: 10.5px; }
:lang(en) #stop, :lang(es) #stop, :lang(pt) #stop, :lang(fr) #stop, :lang(de) #stop, :lang(ko) #stop { letter-spacing: 1px; }
:lang(en) #r-name, :lang(es) #r-name, :lang(pt) #r-name, :lang(fr) #r-name, :lang(de) #r-name { font-size: 23px; line-height: 1.2; hyphens: auto; }
:lang(en) #r-name.long, :lang(es) #r-name.long, :lang(pt) #r-name.long, :lang(fr) #r-name.long, :lang(de) #r-name.long { font-size: 19px; }
:lang(en) #named b, :lang(es) #named b, :lang(pt) #named b, :lang(fr) #named b, :lang(de) #named b { font-size: clamp(15px, 4.4vw, 20px); }
:lang(en) #r-ok, :lang(es) #r-ok, :lang(pt) #r-ok, :lang(fr) #r-ok, :lang(de) #r-ok, :lang(ko) #r-ok { font-size: 14px; max-width: 60%; text-align: center; }
:lang(en) #r-ok small, :lang(es) #r-ok small, :lang(pt) #r-ok small, :lang(fr) #r-ok small, :lang(de) #r-ok small, :lang(ko) #r-ok small { font-size: 15px; letter-spacing: 1px; }
:lang(en) #r-post, :lang(es) #r-post, :lang(pt) #r-post, :lang(fr) #r-post, :lang(de) #r-post { font-size: 16px; }
:lang(en) #r-img, :lang(es) #r-img, :lang(pt) #r-img, :lang(fr) #r-img, :lang(de) #r-img, :lang(en) #again, :lang(es) #again, :lang(pt) #again, :lang(fr) #again, :lang(de) #again { font-size: 12px; white-space: normal; line-height: 1.15; }
:lang(en) .m-head, :lang(es) .m-head, :lang(pt) .m-head, :lang(fr) .m-head, :lang(de) .m-head { letter-spacing: 1px; }
