/* ぷかぷかバーガー — アプリ版の Theme.swift と同じ色・同じ書体
   GD-065 ガチャガチャ＋GD-069 ソフビの文字：平らな色・墨の縁・ずらしたベタの影
   レイアウト：スマホ縦 1 画面。PC では中央にスマホ幅の本体を置く */
:root {
  --yellow: #ffd447;
  --yellow-dot: #f4b915;
  --ink: #2a1d14;
  --ketchup: #e8463b;
  --ketchup-dark: #a8251d;
  --mustard: #ffc93c;
  --mustard-dark: #d99a12;
  --cream: #fff1d6;
  --paper: #fffdf7;
  --cocoa: var(--ink);
  --lettuce: #58b947;
  --lettuce-dark: #2f7a22;
  --sky: #7fd3e8;
  --font-pop: 'M PLUS 1p', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--font-pop);
  font-weight: 800;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--ketchup); outline-offset: 3px; border-radius: 14px; }
svg.i { width: 1em; height: 1em; display: block; fill: currentColor; flex: none; }

#app {
  position: relative;
  height: 100%;
  max-width: 460px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--yellow);
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* 水玉の紙：平らな地色に小さな丸を互い違いに並べる */
.dots {
  --base: var(--yellow); --dot: var(--yellow-dot); --sp: 22px; --r: 2.6px;
  background:
    radial-gradient(circle, var(--dot) var(--r), transparent calc(var(--r) + .5px)) 0 0 / var(--sp) calc(var(--sp) * 1.732),
    radial-gradient(circle, var(--dot) var(--r), transparent calc(var(--r) + .5px)) calc(var(--sp) / 2) calc(var(--sp) * .866) / var(--sp) calc(var(--sp) * 1.732),
    var(--base);
}

/* 縁取り文字：後ろに墨の太い縁とずらした影、前に平らな塗り */
.ol { position: relative; display: inline-block; font-weight: 900; white-space: nowrap; line-height: 1.15;
  color: transparent; --st: var(--ink); --w: 3px; --fill: #fff; --depth: 0px; --dc: var(--st); }
.ol::before {
  content: attr(data-text); position: absolute; left: 0; top: 0; z-index: 0;
  color: var(--st); -webkit-text-stroke: calc(var(--w) * 2) var(--st);
  paint-order: stroke fill;
  text-shadow: 0 var(--depth) 0 var(--dc);
}
.ol::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; z-index: 1;
  color: var(--fill); -webkit-text-stroke: 0;
}

/* 墨の札（GD-065 の em）：墨の四角に黄色の等幅文字 */
.tag { display: inline-block; background: var(--ink); color: var(--yellow); font: 700 11px/1.2 var(--font-mono);
  letter-spacing: .16em; padding: .35em .7em; white-space: nowrap; }
.tag.jp { font-family: var(--font-pop); font-weight: 900; letter-spacing: 0; }
.tag.inv { background: var(--yellow); color: var(--ink); }

/* 押すと沈む厚いボタン：平らな塗り・墨の縁・真下にベタの影 */
.tbtn { position: relative; display: block; width: 100%; height: 50px; --fill: var(--ketchup); --dark: var(--ketchup-dark);
  --fg: #fff; --r: 15px; --drop: 6px; --dc: var(--ink); --line: 2.5px; --lc: var(--ink); }
.tbtn.big { height: 62px; --r: 18px; }
.tbtn::before { content: ""; position: absolute; inset: 0; border-radius: var(--r); background: var(--dc); transform: translateY(var(--drop)); }
.tbtn > .face { position: absolute; inset: 0; border-radius: var(--r); background: var(--fill); border: var(--line) solid var(--lc); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--fg); font-size: 17px; font-weight: 900;
  box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--dark) 60%, transparent); transition: transform .08s; }
.tbtn.big > .face { font-size: 23px; }
.tbtn > .face svg { width: 15px; height: 15px; }
.tbtn.big > .face svg { width: 20px; height: 20px; }
.tbtn:active > .face, .tbtn.down > .face { transform: translateY(calc(var(--drop) - 1px)); }
.tbtn.paper { --fill: var(--paper); --dark: var(--cream); --fg: var(--ink); }
.tbtn.yellow { --fill: var(--yellow); --dark: var(--mustard-dark); --fg: var(--ink); }

/* 角の丸い四角のアイコンボタン */
.sq { position: relative; display: block; width: 44px; height: 44px; flex: none; --fill: var(--paper); --fg: var(--ink); --dc: var(--ink); --lc: var(--ink); }
.sq::before { content: ""; position: absolute; inset: 0; border-radius: 13px; background: var(--dc); transform: translateY(4px); }
.sq > .face { position: absolute; inset: 0; border-radius: 13px; background: var(--fill); border: 2.5px solid var(--lc); box-sizing: border-box;
  display: grid; place-items: center; color: var(--fg); transition: transform .08s; }
.sq > .face svg { width: 20px; height: 20px; }
.sq:active > .face { transform: translateY(3px); }
.labeled { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 10px; color: var(--ink); }

@keyframes pulse { from { transform: scale(calc(1 - var(--pa, .05) * .4)); } to { transform: scale(calc(1 + var(--pa, .05))); } }
.pulse { animation: pulse .55s ease-in-out infinite alternate; }
@keyframes floaty { from { transform: translateY(calc(var(--amp, 7px) * -1)) rotate(-2deg); } to { transform: translateY(var(--amp, 7px)) rotate(2deg); } }
.floaty { animation: floaty var(--per, 1.3s) ease-in-out infinite alternate; animation-delay: var(--ph, 0s); }

/* 伝票：下がギザギザの紙に墨の縁とベタの影。紙と墨は後ろの 2 枚の層で描き、中身はその上 */
.receipt { position: relative; isolation: isolate; --drop: 6px; --t: 10px; }
.receipt::before, .receipt::after { content: ""; position: absolute; z-index: -1; border-radius: 6px 6px 0 0;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--t) / 2) no-repeat, conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) var(--mx, 0px) 100% / var(--t) calc(var(--t) / 2) repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--t) / 2) no-repeat, conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) var(--mx, 0px) 100% / var(--t) calc(var(--t) / 2) repeat-x; }
.receipt::before { inset: -2.5px -2.5px calc(-2.5px - var(--drop)) -2.5px; background: var(--ink); --mx: 2.5px; border-radius: 8px 8px 0 0; }
.receipt::after { inset: 0; background: var(--paper); }

/* 起動 */
.boot { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 24px; z-index: 50; transition: opacity .3s; }
.boot-logo .ol { font-size: 34px; --w: 4px; --fill: var(--ketchup); --depth: 4px; transform: rotate(-4deg); }
.boot-bar { width: 180px; height: 12px; border: 2.5px solid var(--ink); background: var(--paper); overflow: hidden; box-sizing: border-box; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--ketchup); transition: width .2s; }

/* タイトル */
.title { align-items: center; padding: 14px 0 12px; }
.title::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: var(--ink);
  clip-path: polygon(0 16%, 100% 0, 100% 100%, 0 100%); }
.title > * { position: relative; z-index: 1; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.logo .tag { font-size: 22px; transform: translateX(-54px) rotate(-5deg); position: relative; z-index: 1; }
.logo .big { font-size: 70px; --w: 7px; --fill: var(--ketchup); --depth: 8px; line-height: 1.05; transform: rotate(-4deg); margin-top: -4px; }
.logo .sub { font: 700 11px/1 var(--font-mono); letter-spacing: 3px; color: var(--ink); margin-top: 14px; }
.hero { flex: 1; width: 100%; position: relative; min-height: 0; }
.hero img { position: absolute; pointer-events: none; }
.hero .bub { position: absolute; border-radius: 50%; border: 2px solid var(--ink); background: rgba(255,253,247,.55); box-sizing: border-box; }
/* あそぶ：GD-065 のコインボタン */
.coinbtn { position: relative; width: calc(100% - 68px); height: 72px; margin-top: 10px; --drop: 7px; }
.coinbtn::before { content: ""; position: absolute; inset: 0; border-radius: 20px; background: var(--ketchup-dark); transform: translateY(var(--drop)); }
.coinbtn .face { position: absolute; inset: 0; border-radius: 20px; background: var(--ketchup); border: 3px solid var(--ink); box-sizing: border-box;
  display: flex; align-items: center; gap: 14px; padding: 0 16px; transition: transform .08s; }
.coinbtn:active .face { transform: translateY(6px); }
.coin { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; box-sizing: border-box; color: #7a5408;
  background: radial-gradient(circle at 35% 30%, #fff7c2, #f2c230 55%, #c99412); border: 4px solid #e0b028; }
.coin svg { width: 18px; height: 18px; margin-left: 2px; }
.coinbtn .tx { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; color: #fff; }
.coinbtn .tx b { font-size: 26px; font-weight: 900; line-height: 1.15; }
.coinbtn .tx small { font: 700 10px/1 var(--font-mono); letter-spacing: 2px; opacity: .85; }
/* 墨の床の上の四角いタイル */
.tiles { display: flex; gap: 10px; width: calc(100% - 52px); margin-top: 18px; }
.tile { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--paper); font-size: 10px; white-space: nowrap; }
.tile .plate { position: relative; width: 100%; height: 50px; }
.tile .plate::before { content: ""; position: absolute; inset: 0; border-radius: 14px; background: #000; transform: translateY(4px); }
.tile .plate i { position: absolute; inset: 0; border-radius: 14px; background: var(--paper); border: 2.5px solid var(--ink); box-sizing: border-box;
  display: grid; place-items: center; color: var(--ink); transition: transform .08s; }
.tile .plate svg { width: 20px; height: 20px; }
.tile:active .plate i { transform: translateY(3px); }
.tile.off { color: rgba(255,253,247,.6); }
.tile.off .plate i { background: var(--ink); border-color: rgba(255,253,247,.5); color: rgba(255,253,247,.6); }
.title .starcount { margin-top: 14px; font-size: 12px; }
.keyhint { font-size: 11px; color: rgba(42,29,20,.65); margin-top: 8px; }

/* メニュー（カードのように裏返る） */
.flipwrap { perspective: 1400px; }
.flipper { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.5,0,.3,1); }
.flipper.back { transform: rotateY(180deg); }
.side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; overflow: hidden; }
.side.secret { transform: rotateY(180deg); }
.select { --base: var(--cream); --dot: color-mix(in srgb, var(--yellow) 55%, var(--cream)); }
.select.secret { --base: var(--ink); --dot: #3e2b1e; }
.selhead { display: flex; align-items: center; justify-content: space-between; padding: 10px max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px)); }
.selhead .ol { font-size: 32px; --w: 4px; --depth: 4px; --fill: var(--ketchup); transform: rotate(-3deg); }
.secret .selhead .ol { font-size: 28px; --fill: var(--yellow); --st: var(--paper); }
.flipbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; color: var(--ink); }
.secret .flipbtn { color: #fff; }
.flipbtn .sq { --fill: var(--ink); --fg: var(--yellow); }
.flipbtn.locked .sq { --fill: var(--cream); --fg: rgba(42,29,20,.45); }
.secret .flipbtn .sq { --fill: var(--ketchup); --fg: #fff; --lc: var(--paper); --dc: var(--paper); }
.selstars { display: flex; justify-content: center; padding: 6px 0 10px; }
.secret .selstars .tag { background: var(--yellow); color: var(--ink); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px)); }
.area { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.areahead { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: #fff; padding: 6px 12px; background: var(--ink); font-size: 16px; font-weight: 900; transform: rotate(-2deg); margin: 2px 0 2px 2px; }
.areahead .an { font: 700 10px/1 var(--font-mono); letter-spacing: 2px; color: var(--yellow); }
.areahead svg { width: 14px; height: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 18px; text-align: center; min-width: 0; box-sizing: border-box;
  background: linear-gradient(var(--ab) 0 6px, var(--paper) 6px) border-box; border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink); margin-bottom: 5px; }
.card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.card.locked { background: rgba(255,253,247,.4); border: 2px dashed rgba(42,29,20,.25); box-shadow: none; cursor: default; }
.card.locked:active { transform: none; }
.secret .card.locked { background: rgba(255,253,247,.08); border-color: rgba(255,253,247,.5); }
.card .row { display: flex; justify-content: space-between; align-items: center; }
.card .num { font: 700 10px/1 var(--font-mono); letter-spacing: 1px; color: var(--yellow); background: var(--ink); padding: 3px 6px; }
.card.locked .num { color: rgba(42,29,20,.4); background: rgba(42,29,20,.08); }
.secret .card.locked .num { color: rgba(255,253,247,.5); background: rgba(255,253,247,.1); }
.card .lock { color: rgba(42,29,20,.35); width: 14px; height: 14px; }
.secret .card.locked .lock { color: rgba(255,253,247,.4); }
.card .burgers { height: 92px; display: flex; justify-content: center; }
.card .burgers img { height: 100%; width: auto; min-width: 0; object-fit: contain; }
.card .burgers img + img { margin-left: -16px; }
.card.locked .burgers { filter: brightness(0); opacity: .16; }
.secret .card.locked .burgers { filter: brightness(0) invert(1); opacity: .16; }
.card .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.secret .card.locked .name { color: rgba(255,253,247,.6); }
.card .best { font: 700 10px/1.3 var(--font-mono); letter-spacing: 1.5px; color: rgba(42,29,20,.55); }
.card .best.new { color: var(--ketchup); }
.stars { display: flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; fill: rgba(42,29,20,.1); stroke: rgba(42,29,20,.18); stroke-width: 2; stroke-linejoin: round; paint-order: stroke; overflow: visible; }
.stars svg.on { fill: var(--yellow); stroke: var(--ink); }

/* ゲーム */
.game { --base: var(--bd); --dot: rgba(42,29,20,.22); --sp: 20px; --r: 2.4px; }
/* おもちゃ本体＝手元のスマホそのもの：本体の色を画面の端まで広げる（縦横比は端末に合わせ、水槽の比率だけ固定） */
.toywrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.toy { position: absolute; inset: 0; z-index: 0; background: var(--b); }
.toy svg.groove { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); overflow: visible; }
.toy .screw { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom, 0px) * .3); width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 1.6px solid var(--ink); box-sizing: border-box; }
.toy .screw::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 1.6px; margin: -.8px 0 0 -3px; background: var(--ink); transform: rotate(35deg); }
.toy .screw.l { left: 24px; } .toy .screw.r { right: 24px; }
.gamecol { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0;
  padding: calc(4px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.stagename { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.stagename .tag { font-size: 10px; }
.stagename .ol { font-size: 19px; --w: 3px; --depth: 3px; --fill: #fff; }
.screenbox { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 5px; }
.screenframe { position: relative; padding: 8px; border-radius: 24px; background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  aspect-ratio: 9.9 / 14.8; height: 100%; max-width: 100%; max-height: 100%; box-sizing: border-box; }
.screenin { position: relative; width: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: #3380bf; }
.screenin canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.glass { position: absolute; inset: 0; pointer-events: none; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(255,255,255,.06)); }
.screenin::after { content: ""; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 2.5px var(--ink); pointer-events: none; z-index: 10; }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.timer { position: absolute; top: 8px; right: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(42,29,20,.82); color: var(--yellow); text-align: right; pointer-events: none; font-variant-numeric: tabular-nums; }
.timer small { display: block; font: 700 9px/1.2 var(--font-mono); letter-spacing: 2px; color: rgba(255,212,71,.75); }
.timer .t { font-size: 24px; font-weight: 900; line-height: 1.1; transition: transform .15s; transform-origin: right center; }
.timer .t span { font-size: 14px; }
.timer .sc { font: 700 11px/1.2 var(--font-mono); color: rgba(255,255,255,.85); }
.timer.hurry { background: rgba(42,29,20,.92); }
.timer.hurry .t { color: #ff6a5c; font-size: 30px; }
.timer.hurry .t.beat { transform: scale(1.12); }
.controls { position: relative; height: 146px; flex: none; }
/* 噴射ボタン：黄の円・墨の縁・内側の細い輪・墨の矢印・墨の影 */
.jet { position: absolute; top: 50%; width: 100px; height: 100px; margin-top: -54px; touch-action: none; }
.jet.l { left: 6px; } .jet.r { right: 6px; }
.jet::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ink); transform: translateY(8px); }
.jet .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--yellow);
  border: 3.5px solid var(--ink); box-sizing: border-box; transition: transform .08s; }
.jet .face::before { content: ""; position: absolute; inset: 5.5px; border-radius: 50%; border: 5px solid color-mix(in srgb, var(--mustard-dark) 55%, var(--yellow)); }
.jet .face svg { position: relative; width: 42px; height: 42px; }
.jet.down .face { transform: translateY(7px); }
.jet .ripple { position: absolute; inset: -14px; border-radius: 50%; border: 4px solid var(--paper); animation: ripple 1.1s ease-out infinite; pointer-events: none; }
@keyframes ripple { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.board { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 8px 10px; pointer-events: none; transition: transform .18s cubic-bezier(.3,1.8,.5,1); --drop: 4px; --t: 7px; }
.board.receipt::before { inset: -2px -2px calc(-2px - var(--drop)) -2px; --mx: 2px; }
.board.bounce { transform: translateX(-50%) scale(1.12); }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bstack { display: flex; flex-direction: column-reverse; align-items: center; }
.bstack .ing { position: relative; display: grid; place-items: center; }
.bstack .ing img { width: 100%; height: 100%; object-fit: contain; }
.bstack .ing.todo img { filter: grayscale(1) brightness(.55); opacity: .45; }
.bstack .ing.next::before { content: ""; position: absolute; width: 95%; height: 60%; border-radius: 50%; background: rgba(255,201,60,.55); filter: blur(5px); animation: pulse .55s ease-in-out infinite alternate; --pa: .15; }
.badge { width: 34px; height: 18px; border-radius: 999px; color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 900; border: 1.5px solid var(--ink); box-sizing: border-box; }
.badge svg { width: 11px; height: 11px; }

/* 注文票（はじまる前） */
.intro { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px; pointer-events: none; transition: opacity .25s, transform .25s; }
.intro.gone { opacity: 0; transform: scale(.95); }
.introcard { width: 100%; padding: 16px 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-sizing: border-box; flex: none; transform-origin: center; }
.introcard .hd { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.introcard .hd .tag { background: var(--ketchup); color: var(--paper); }
.introcard .hd small { font: 700 11px/1 var(--font-mono); letter-spacing: 2px; color: rgba(42,29,20,.55); }
.introcard h2 { margin: 0; font-size: 22px; font-weight: 900; text-wrap: balance; text-align: center; }
.orders { width: 100%; display: flex; gap: 8px; align-items: flex-end; }
.orders > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.orders img.burger { height: 84px; max-width: 100%; object-fit: contain; }
.orders.one img.burger { height: 120px; }
.pickname { white-space: nowrap; display: flex; align-items: center; gap: 4px; color: #fff; padding: 3px 8px; border-radius: 999px; font-size: 11px; }
.pickname svg { width: 11px; height: 11px; }
.inglist { display: flex; flex-direction: column; gap: 1px; align-self: center; }
.inglist div { display: flex; align-items: center; gap: 4px; font-size: 10px; color: rgba(42,29,20,.85); white-space: nowrap; }
.inglist img { width: 16px; height: 16px; }
.dotted { width: 100%; height: 1.5px; background: radial-gradient(circle, rgba(42,29,20,.35) .75px, transparent 1px) 0 0 / 6px 1.5px repeat-x; }
.newthing { display: flex; gap: 10px; align-items: center; width: 100%; }
.newthing img { width: 64px; height: 64px; border-radius: 50%; background: var(--cream); flex: none; object-fit: contain; }
.newthing .t { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; }
.newthing .t b { font-size: 10px; color: #fff; background: var(--ketchup); border-radius: 99px; padding: 2px 6px; }
.newthing p, .hint { margin: 3px 0 0; font-size: 11px; color: rgba(42,29,20,.75); line-height: 1.45; }
.hint { font-size: 12px; text-align: center; }
.glowlegend { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(255,201,60,.18); font-size: 12px; }
.glowlegend span { position: relative; width: 32px; height: 32px; display: grid; place-items: center; }
.glowlegend span::before { content: ""; position: absolute; width: 34px; height: 24px; border-radius: 50%; background: rgba(255,201,60,.7); filter: blur(6px); animation: pulse .55s ease-in-out infinite alternate; --pa: .15; }
.glowlegend img { position: relative; width: 32px; height: 32px; }
.small { font-size: 11px; color: rgba(42,29,20,.75); }
.startcue { white-space: nowrap; display: flex; align-items: center; gap: 4px; color: #fff; background: var(--ketchup); border-radius: 999px; padding: 9px 14px; font-size: 13px; --pa: .04; }
.startcue svg { width: 16px; height: 16px; }
.limits { display: flex; gap: 10px; font-size: 11px; color: rgba(42,29,20,.7); align-items: center; flex-wrap: wrap; justify-content: center; }
.limits span { display: flex; align-items: center; gap: 2px; }
.limits svg { width: 10px; height: 10px; color: var(--mustard-dark); }
.limits svg.tm { width: 12px; height: 12px; color: rgba(42,29,20,.7); }

/* 結果・時間切れ */
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(42,29,20,.6);
  padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); animation: fadein .25s both; }
@keyframes fadein { from { opacity: 0; } }
@keyframes cardin { from { transform: scale(.6) rotate(-6deg); opacity: 0; } 60% { transform: scale(1.04) rotate(1deg); opacity: 1; } }
.resultcard { width: 100%; padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; box-sizing: border-box; max-height: calc(100% - 24px);
  --drop: 8px; --t: 12px; animation: cardin .45s cubic-bezier(.3,1.3,.5,1) both; }
.resultcard .scrollin { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; margin: -4px; padding: 4px; }
.resultcard .heroban { position: relative; flex: none; height: 150px; border-radius: 16px; overflow: hidden; display: flex; justify-content: center; align-items: center;
  --sp: 16px; --r: 2.2px; border: 2.5px solid var(--ink); box-sizing: border-box; }
.resultcard .heroban .imgs { position: relative; display: flex; height: 120px; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.resultcard .heroban .imgs img { height: 100%; }
.resultcard .heroban .imgs img + img { margin-left: -10px; }
.resultcard .done { align-self: center; font-size: 28px; --w: 4px; --depth: 4px; --fill: var(--ketchup); animation: popin .4s cubic-bezier(.3,1.5,.5,1) both .1s; }
@keyframes popin { from { transform: scale(1.6) rotate(-3deg); opacity: 0; } }
.resultcard .done, .gameovercard .ol { transform: rotate(-3deg); }
.stamps { display: flex; justify-content: center; gap: 12px; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; color: rgba(42,29,20,.4); }
.stamp i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(42,29,20,.05); border: 2px dashed rgba(42,29,20,.2); color: rgba(42,29,20,.12); box-sizing: border-box; transform: scale(.85); transition: transform .3s cubic-bezier(.3,1.8,.5,1); }
.stamp i svg { width: 22px; height: 22px; }
.stamp.ok { color: rgba(42,29,20,.85); }
.stamp.lit i { background: var(--yellow); border: 2.5px solid var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); transform: scale(1) rotate(var(--rot)); }
.lines { display: flex; flex-direction: column; gap: 7px; padding: 0 6px; }
.line { display: flex; align-items: center; gap: 6px; font-size: 14px; animation: slidein .25s both; }
@keyframes slidein { from { transform: translateX(-20px); opacity: 0; } }
.line .dl { flex: 1; height: 1.5px; background: radial-gradient(circle, rgba(42,29,20,.35) .75px, transparent 1px) 0 0 / 6px 1.5px repeat-x; }
.line b { font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 900; }
.rule { height: 2px; background: var(--ink); margin: 2px 6px 0; }
.total { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 900; padding: 0 6px; }
.total b { font-size: 34px; color: var(--ketchup); font-variant-numeric: tabular-nums; }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(42,29,20,.6); min-height: 26px; padding: 0 6px; }
.meta .tag { font-size: 13px; transform: rotate(-4deg); }
.btns { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; padding-bottom: 6px; }
.btns .row2 { display: flex; gap: 10px; }
.gameovercard { width: 100%; padding: 22px 22px 30px; display: flex; flex-direction: column; gap: 14px; align-items: center; box-sizing: border-box; margin: 0 10px;
  --drop: 8px; --t: 12px; animation: cardin .4s cubic-bezier(.3,1.3,.5,1) both; }
.gameovercard .ol { font-size: 40px; --w: 4.5px; --depth: 5px; --fill: var(--sky); }
.gameovercard p { margin: 0; font-size: 14px; }
.goorders { display: flex; gap: 14px; padding: 6px 0; }
.goorders div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; font-weight: 900; }
.goorders img { height: 80px; }
.goorders img.no { filter: saturate(.2); opacity: .6; }
.gameovercard .btns { width: 100%; }

/* 浮かぶ文字 */
.pop { position: absolute; transform: translate(-50%, -50%); text-align: center; animation: popup 1.06s forwards; white-space: nowrap; }
.pop .ol { font-size: 24px; --w: 2.5px; }
.pop .s { display: block; }
.pop .s .ol { font-size: 13px; --fill: var(--yellow); }
@keyframes popup {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  8% { transform: translate(-50%, -50%) scale(1.25); }
  15% { transform: translate(-50%, -50%) scale(1); }
  60% { opacity: 1; }
  100% { transform: translate(-50%, calc(-50% - 34px)) scale(1); opacity: 0; }
}
.banner { position: absolute; transform: translate(-50%, -50%) rotate(-4.6deg); animation: banner 1.2s forwards; }
.banner .ol { font-size: 30px; --w: 2.5px; --fill: var(--yellow); }
@keyframes banner {
  0% { transform: translate(-50%, -50%) rotate(-4.6deg) scale(.2); opacity: 1; }
  8% { transform: translate(-50%, -50%) rotate(-4.6deg) scale(1.3); }
  17% { transform: translate(-50%, -50%) rotate(-4.6deg) scale(1); }
  75% { transform: translate(-50%, -50%) rotate(-4.6deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, calc(-50% - 20px)) rotate(-4.6deg); opacity: 0; }
}
.warnmark { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink);
  display: grid; place-items: center; color: var(--ink); font: 900 22px/1 var(--font-pop); box-sizing: border-box; }
.warnmark.big { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: var(--ketchup); color: #fff; font-size: 28px; }

/* クレジット */
.sheet { position: absolute; inset: 0; z-index: 30; --base: var(--cream); --dot: color-mix(in srgb, var(--yellow) 50%, var(--cream)); overflow-y: auto; animation: sheetin .3s cubic-bezier(.2,.9,.3,1) both;
  padding: 24px max(24px, env(safe-area-inset-right, 0px)) 40px max(24px, env(safe-area-inset-left, 0px)); }
@keyframes sheetin { from { transform: translateY(100%); } }
.sheet .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sheet h2 { margin: 0; font-size: 24px; font-weight: 900; }
.credit { margin-bottom: 18px; }
.credit small { display: block; color: var(--ketchup); font-size: 12px; }
.credit b { display: block; font-size: 17px; font-weight: 900; }
.credit a, .credit span { font-size: 11px; color: rgba(42,29,20,.6); word-break: break-all; }
.sheet pre { white-space: pre-wrap; font: 10px/1.5 var(--font-mono); color: rgba(42,29,20,.7); }

@media (prefers-reduced-motion: reduce) {
  .floaty, .pulse { animation: none; }
}

/* チュートリアル（ステージ 1） */
.tut { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; padding: 10px 14px; box-sizing: border-box; }
.tut.top { justify-content: flex-start; }
.tut.center { justify-content: center; background: rgba(0,0,0,.35); }
.tut:empty { display: none; }
.tcard { padding: 12px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: fadein .25s; --drop: 4px; --t: 9px; }
.tcard .row { display: flex; gap: 10px; align-items: center; width: 100%; }
.tcard b { display: block; font-size: 16px; font-weight: 900; }
.tcard p { margin: 3px 0 0; font-size: 12px; font-weight: 800; color: rgba(42,29,20,.85); line-height: 1.45; }
.tcard .badge { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 0; }
.tcard .badge svg { width: 22px; height: 22px; fill: currentColor; }
.tcard .badge.red { background: var(--ketchup); }
.tcard .badge.blue { background: #4099f2; }
.tcard .ingpic { flex: none; position: relative; width: 40px; height: 40px; }
.tcard .ingpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tcard .ingpic i { position: absolute; left: 0; right: 0; top: 5px; height: 30px; border-radius: 50%; background: rgba(255,201,60,.6); filter: blur(6px); animation: pulse .6s ease-in-out infinite alternate; }
.tnext { pointer-events: auto; display: flex; align-items: center; gap: 4px; border: 2px solid var(--ink); cursor: pointer; font: inherit; font-size: 15px; font-weight: 900; color: #fff; background: var(--ketchup); padding: 8px 22px; border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.tnext svg { width: 13px; height: 13px; fill: currentColor; }
.tnext:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tut .startcue { font-size: 12px; padding: 6px 12px; }
.tipmark { position: absolute; transform: translate(-50%, calc(-100% - 6px)); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ketchup); animation: tipbob .45s ease-in-out infinite alternate; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.tipmark span { font-size: 11px; font-weight: 900; color: #fff; background: var(--ketchup); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tipmark svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes tipbob { to { margin-top: -6px; } }
.boardarrow { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); color: var(--ketchup); pointer-events: none; animation: tipbob .45s ease-in-out infinite alternate; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }
.boardarrow svg { width: 24px; height: 24px; fill: currentColor; }
.boardarrow[hidden] { display: none; }
