:root {
  --bg: #fff7ec;
  --card: #ffffff;
  --ink: #2a1f17;
  --sub: #7a6a5c;
  --line: #eadfd0;
  --red: #e2453c;
  --red-soft: #fde6e3;
  --on-red: #ffffff;
  --green: #2f8f5b;
  --green-soft: #def3e6;
  --gold: #f2b632;
  --gold-soft: #fff1cc;
  --shadow: 0 1px 2px rgba(60, 30, 10, .08), 0 4px 14px rgba(60, 30, 10, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1613;
    --card: #2a221d;
    --ink: #f6ece2;
    --sub: #b6a596;
    --line: #43372f;
    --red: #ef5b51;
    --red-soft: #4a2521;
    --green: #4cc083;
    --green-soft: #1f3a2b;
    --gold: #f5c04a;
    --gold-soft: #4a3d17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
#app { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 1.05rem; margin-bottom: 6px; }
p { margin: 0 0 8px; }
.hint { color: var(--sub); font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.mt { margin-top: 12px; }

/* ---- ヘッダー ---- */
.top {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 12px 0 8px;
}
.brand { font-weight: 800; font-size: 1.1rem; }
.roominfo { font-size: .8rem; color: var(--sub); display: flex; align-items: center; gap: 6px; min-width: 0; }
.roominfo b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: var(--red); }
.banner {
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px;
  padding: 10px 12px; font-size: .9rem; margin-bottom: 10px;
  display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}

/* ---- カード・ボタン ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card > summary { cursor: pointer; font-weight: 700; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; border-radius: 12px; padding: 12px 16px; min-height: 48px;
  cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

input[type=text] {
  font: inherit; font-size: 16px; /* 16px 未満だと iOS が拡大する */
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); min-height: 48px;
}
input[type=text]:focus { outline: 2px solid var(--red); outline-offset: 1px; }
label.field { display: block; font-size: .85rem; color: var(--sub); margin-bottom: 10px; }
label.field input { margin-top: 4px; }

/* ---- 入室画面 ---- */
.hero { text-align: center; padding: 32px 0 16px; }
.hero .logo { font-size: 3.4rem; line-height: 1; }
.hero h1 { font-size: 1.7rem; margin-top: 8px; }
.error { color: var(--red); font-weight: 700; font-size: .9rem; margin: 6px 0; }

/* ---- プレイヤー ---- */
.players { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: .85rem; font-weight: 600;
}
.chip.me { border-color: var(--red); background: var(--red-soft); }
.chip.off { opacity: .45; }
.chip.ok { background: var(--green-soft); border-color: var(--green); }
.chip.eaten { background: var(--gold-soft); border-color: var(--gold); font-weight: 500; }
.chip.miss { background: var(--red-soft); border-color: var(--red); }

/* ---- ネタ編集 ---- */
.neta-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.neta-row input { flex: 1 1 auto; min-width: 0; }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button { width: 40px; height: 44px; padding: 0; font-size: 1.2rem; }
.stepper .cnt { min-width: 26px; text-align: center; font-weight: 800; }
.chips-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chips-quick button { font-size: .85rem; padding: 6px 10px; border-radius: 999px; border: 1px dashed var(--sub); background: transparent; color: var(--ink); min-height: 34px; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.photos img { height: 110px; width: auto; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ネタ選択グリッド ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 420px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.neta-card {
  position: relative; appearance: none; font: inherit; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 16px;
  padding: 14px 6px 10px; min-height: 92px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: var(--shadow); touch-action: manipulation; transition: transform .08s, border-color .1s;
}
.neta-card:active { transform: scale(.97); }
.neta-card .emo { font-size: 1.9rem; line-height: 1.1; }
.neta-card .nm { font-weight: 700; font-size: .95rem; word-break: break-all; }
.neta-card .badge {
  position: absolute; top: 6px; right: 8px; font-size: .75rem; font-weight: 800;
  background: var(--bg); border-radius: 999px; padding: 0 7px; border: 1px solid var(--line);
}
.neta-card .mark { position: absolute; top: 4px; left: 8px; font-size: .9rem; }
.neta-card.sel { border-color: var(--red); background: var(--red-soft); }
.neta-card.sel::after { content: "✔"; position: absolute; bottom: 4px; right: 8px; color: var(--red); font-weight: 900; }
.neta-card.gone { opacity: .35; cursor: not-allowed; filter: grayscale(1); }

/* ---- ラウンド・発表 ---- */
.round-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px; }
.round-head h2 { font-size: 1.25rem; margin: 0; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--red); transition: width .3s; }
.entry {
  border-radius: 16px; padding: 14px; margin-bottom: 10px; border: 2px solid var(--line);
  background: var(--card); box-shadow: var(--shadow);
}
.entry .who { font-size: .85rem; color: var(--sub); }
.entry .main { font-size: 1.15rem; font-weight: 800; margin: 2px 0; }
.entry .sub { font-size: .9rem; }
.entry.win { border-color: var(--green); background: var(--green-soft); }
.entry.lose { border-color: var(--red); background: var(--red-soft); }
.entry.rolling { border-color: var(--gold); background: var(--gold-soft); }
.rl-msg { font-weight: 800; }
.roulette { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rl-name {
  padding: 6px 14px; border-radius: 999px; border: 2px solid var(--gold); background: var(--card);
  font-weight: 800; font-size: 1.05rem; transition: transform .08s, background-color .08s, opacity .25s;
}
.rl-name small { font-weight: 500; font-size: .75rem; margin-left: 2px; }
.rl-name.on { background: var(--gold); color: #3a2a00; transform: scale(1.12); }
.rl-name.hit { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.2); animation: hit .5s cubic-bezier(.2, 1.6, .4, 1); }
.rl-name.out { opacity: .35; text-decoration: line-through; }
@keyframes hit { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) {
  .rl-name { transition: none; }
  .rl-name.on, .rl-name.hit { transform: none; animation: none; }
}
.entry.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.entry.lose.pop { animation: shake .5s; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* ---- 結果 ---- */
.awards { display: grid; gap: 8px; margin-bottom: 12px; }
.award { display: flex; gap: 10px; align-items: center; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 14px; padding: 10px 12px; }
.award .ic { font-size: 1.7rem; }
.award .t { font-size: .8rem; color: var(--sub); }
.award .v { font-weight: 800; }
.pcard h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pcard .rate { font-size: 1.3rem; color: var(--green); font-weight: 900; }
.pcard .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.pcard .lab { font-size: .8rem; color: var(--sub); font-weight: 700; margin-top: 8px; }
.log { font-size: .88rem; margin: 2px 0; }
.log b { font-weight: 700; }
details.mini { margin-top: 8px; }
details.mini > summary { font-size: .85rem; color: var(--sub); cursor: pointer; }

/* ---- 下部の操作バー ---- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bar-inner { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; }
.bar .btn { flex: 1; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #2a1f17; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .9rem; max-width: 90vw;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 1貫ごとの表示(切り抜き・特徴メモ) ---- */
.grp { margin: 16px 0 6px; font-size: 1rem; }
.grp small { color: var(--sub); font-weight: 500; }
.thumb { object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.note { display: block; font-size: .78rem; color: var(--sub); line-height: 1.3; }
.chip small { font-weight: 400; color: var(--sub); margin-left: 2px; }
.neta-card .thumb { width: 76px; height: 76px; }
.neta-card .note {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 0 4px; font-size: .72rem;
}
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.item-row .emo, .item-row .thumbbtn { width: 60px; height: 60px; flex: none; }
.item-row .emo { display: grid; place-items: center; font-size: 1.8rem; background: var(--bg); border-radius: 10px; }
.thumbbtn { padding: 0; border: 0; background: none; cursor: pointer; }
.thumbbtn .thumb { width: 100%; height: 100%; }
.item-row .fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.item-row .fields input { min-height: 40px; padding: 8px 10px; }
.item-row .acts { display: flex; flex-direction: column; gap: 4px; flex: none; }
.item-row .acts .btn { width: 42px; min-height: 38px; padding: 0; }
.erow { display: flex; gap: 12px; align-items: center; }
.erow .thumb, .erow .emo { width: 76px; height: 76px; flex: none; }
.emo.lg { display: grid; place-items: center; font-size: 2.6rem; }
.etext { min-width: 0; }

/* ---- 写真上の枠(切り出し範囲)の編集 ---- */
.ed-stage { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ed-stage img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); pointer-events: none; -webkit-user-drag: none; }
.ed-stage.drawing { cursor: crosshair; touch-action: none; }
.ed-stage.drawing img { outline: 3px solid var(--gold); }
.bx {
  position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .6);
  background: rgba(226, 69, 60, .14); touch-action: none; cursor: move;
}
.bx.sel { border-color: var(--gold); background: rgba(242, 182, 50, .24); z-index: 2; }
.ed-stage.drawing .bx:not(.tmp) { pointer-events: none; }
.bx .bn {
  position: absolute; left: 0; top: 0; background: rgba(0, 0, 0, .7); color: #fff; pointer-events: none;
  font: 700 11px/1 sans-serif; padding: 3px 5px; border-radius: 0 0 6px 0;
}
.bx .hd { display: none; position: absolute; width: 20px; height: 20px; background: var(--gold); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); touch-action: none; }
.bx .hd::after { content: ""; position: absolute; inset: -12px; } /* 指で触れやすい当たり判定 */
.bx.sel .hd { display: block; }
.bx .hd[data-h=tl] { left: -11px; top: -11px; }
.bx .hd[data-h=br] { right: -11px; bottom: -11px; }
.item-row.sel { background: var(--gold-soft); border-radius: 12px; padding: 6px; margin-left: -6px; margin-right: -6px; }
.thumbbtn { position: relative; }
.thumbbtn .rn {
  position: absolute; left: 2px; top: 2px; z-index: 1; background: rgba(0, 0, 0, .7); color: #fff;
  font: 700 11px/1 sans-serif; padding: 3px 5px; border-radius: 6px;
}
.thumbbtn .emo { width: 100%; height: 100%; }
input.need { border-color: var(--red); }
.item-row .acts .btn { min-height: 34px; width: 40px; }

/* ---- 寿司の番号 ---- */
.neta-card .no {
  position: absolute; top: 6px; left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--ink); color: var(--bg); font-size: .78rem; font-weight: 800; display: grid; place-items: center;
}
.neta-card .mark { top: auto; bottom: 6px; left: 8px; }
.nob {
  display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .35em; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: .75em; font-weight: 800; margin-right: .3em; vertical-align: .08em;
}
.nmrow { display: flex; gap: 6px; }
.nmrow input.noin { width: 64px; flex: none; text-align: center; font-weight: 800; }

/* ゲーム中の番号つき写真(枠をタップして選ぶ) */
.np-stage { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; }
.np-stage img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); pointer-events: none; -webkit-user-drag: none; }
.bx.np { cursor: pointer; touch-action: manipulation; background: rgba(255, 255, 255, .08); }
.bx.np .bn { font-size: 13px; padding: 3px 6px; }
.bx.np.sel { border-color: var(--red); background: rgba(226, 69, 60, .3); z-index: 2; }
.bx.np.gone { opacity: .6; border-style: dashed; background: rgba(0, 0, 0, .55); cursor: default; }
.bx.np .x { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.5rem; font-weight: 900; pointer-events: none; }

/* ---- AI が数えた個数と枠の照合 / 位置が未確認の枠 ---- */
.expect { border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; font-size: .9rem; border: 1px solid var(--line); background: var(--bg); }
.expect.ok { background: var(--green-soft); border-color: var(--green); }
.expect.warn { background: var(--gold-soft); border-color: var(--gold); }
.expect .btn { margin-top: 4px; }
.bx.pend { border-style: dashed; border-color: var(--red); background: rgba(226, 69, 60, .3); }
.bx.pend .bn { background: var(--red); }
.pendnote { font-size: .75rem; color: var(--red); font-weight: 700; margin-top: 4px; }

/* ---- 範囲からの判定(まとめて判定・自動判定) ---- */
.item-row .acts { display: grid; grid-template-columns: repeat(2, 40px); gap: 4px; }
.identbar { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.autotog { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; cursor: pointer; }
.autotog input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* ---- 希望の上限(全体の寿司数 ÷ 参加者数) ---- */
.quota { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: .9rem; }
.quota.full { background: var(--green-soft); border-color: var(--green); }
.stickyq {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .95rem;
}
.stickyq.full { border-color: var(--green); background: var(--green-soft); }
.stickyq .progress { margin-top: 6px; }
.stickyq.full .progress > i { background: var(--green); }
.neta-card.lock { opacity: .45; }
.bx.np.lock { opacity: .5; }

/* ---- 結果発表: 食べた寿司の写真を横並びで表示 ---- */
.estrip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin: 4px 0 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.etile { position: relative; flex: none; width: 96px; margin: 0; text-align: center; scroll-snap-align: start; }
.etile .thumb, .etile .emo.xl { width: 96px; height: 96px; border-radius: 12px; display: block; }
.emo.xl { display: grid; place-items: center; font-size: 2.6rem; background: var(--bg); border: 1px solid var(--line); }
.etile figcaption { margin-top: 4px; font-size: .78rem; line-height: 1.3; font-weight: 700; }
.etile figcaption small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--sub); font-weight: 400; font-size: .72rem; }
.etile .round { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; z-index: 1; }
.etile .hitmark { position: absolute; top: 2px; left: 4px; font-size: 1.1rem; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.etile.hit .thumb, .etile.hit .emo.xl { outline: 3px solid var(--gold); outline-offset: -1px; }

/* ---- 同じラウンドの敗者ドラフト(外れた人だけ) ---- */
.kindtag { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--red); color: var(--on-red); vertical-align: middle; }
.loser-banner { margin-bottom: 12px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--red); background: var(--red-soft); }
.loser-banner .rb-title { font-weight: 800; margin-bottom: 4px; }
.loser-banner .rb-me { margin-top: 6px; font-weight: 800; }
.chip.rest { opacity: .55; border-style: dashed; }
.splash { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(20, 10, 5, .6); cursor: pointer; animation: fadein .2s; }
.splash-card { width: min(92vw, 380px); text-align: center; padding: 26px 20px; border-radius: 22px; background: var(--card); border: 3px solid var(--green); box-shadow: 0 10px 40px rgba(0, 0, 0, .4); animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.splash-card.loser { border-color: var(--red); }
.sp-icon { font-size: 3.4rem; line-height: 1; }
.sp-title { font-size: 1.6rem; font-weight: 900; margin-top: 8px; }
.sp-sub { margin: 6px 0 10px; color: var(--sub); font-weight: 700; }
.sp-names { justify-content: center; margin-bottom: 8px; }
.sp-me { font-size: 1.15rem; font-weight: 900; margin-bottom: 8px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---- 結果発表: みんなが食べた寿司を見比べる一覧 ---- */
.board .brow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--line); }
.board .brow:first-of-type { border-top: 0; }
.board .brow.me { background: var(--red-soft); margin: 0 -8px; padding: 8px; border-radius: 12px; border-top-color: transparent; }
.board .bname { flex: none; width: 72px; font-weight: 800; font-size: .9rem; line-height: 1.25; word-break: break-all; }
.board .bname small { display: block; color: var(--sub); font-weight: 500; font-size: .72rem; }
.board .bstrip { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 auto; min-width: 0; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; }
.btile { position: relative; flex: none; width: 64px; text-align: center; }
.btile .thumb, .btile .emo.md { width: 64px; height: 64px; border-radius: 10px; display: block; }
.emo.md { display: grid; place-items: center; font-size: 1.8rem; background: var(--bg); border: 1px solid var(--line); }
.btile .no { position: absolute; left: 2px; top: 2px; font-style: normal; background: rgba(0, 0, 0, .7); color: #fff; font-size: .62rem; font-weight: 800; padding: 1px 5px; border-radius: 6px; }
.btile .star { position: absolute; right: 0; top: -2px; font-size: .95rem; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.btile em { display: block; font-style: normal; font-size: .68rem; line-height: 1.2; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btile.hit .thumb, .btile.hit .emo.md { outline: 3px solid var(--gold); outline-offset: -1px; }

/* ---- 結果のエクスポート ---- */
.expgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.expgrid .btn { min-height: 52px; padding: 8px; font-size: .95rem; }
.expgrid .btn:first-child { grid-column: 1 / -1; }
.expprev { margin-top: 12px; }
.expprev img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); -webkit-touch-callout: default; }
.exptext { margin-top: 12px; }
.exptext textarea { width: 100%; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }

/* ---- 写真の拡大・移動 / 全画面ビュー / 寿司1貫の拡大表示 ---- */
body.noscroll { overflow: hidden; }
.zwrap { position: relative; overflow: hidden; border-radius: 12px; touch-action: pan-y; }
.zwrap.zoomed { touch-action: none; }
.zworld { position: relative; transform-origin: 0 0; will-change: transform; --z: 1; }
/* 拡大しても、枠の線・番号・つまみは画面上で同じ大きさに保つ(--z = 倍率) */
.zwrap .bx { border-width: calc(2px / var(--z)); box-shadow: 0 0 0 calc(1.5px / var(--z)) rgba(0, 0, 0, .6); }
.zwrap .bx .bn { transform: scale(calc(1 / var(--z))); transform-origin: 0 0; }
.zwrap .bx .hd { transform: scale(calc(1 / var(--z))); }
.zwrap .bx.np .x { font-size: calc(1.5rem / var(--z)); }
.zctl { position: absolute; right: 6px; top: 6px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.zctl button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.zlabel { display: none; position: absolute; left: 6px; bottom: 6px; z-index: 6; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: .78rem; font-weight: 700; pointer-events: none; }
.zwrap.zoomed .zlabel { display: block; }

.fs { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #0d0a08; color: #fff; }
.fs-top { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; }
.fs-body { flex: none; position: relative; width: 100%; }
.fs .zwrap { width: 100%; border-radius: 0; touch-action: none; background: #000; }
.fs .zworld { position: absolute; inset: 0; }
.fs-bottom { flex: none; height: 66px; display: flex; align-items: center; gap: 10px; padding: 0 12px; overflow-x: auto; white-space: nowrap; }
.fs .hint { color: #bfb5aa; }

.neta-card .zoombtn { position: absolute; top: 4px; right: 4px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: .85rem; }
.etile, .btile, .tapimg { cursor: zoom-in; }

.iv { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.iv-back { position: absolute; inset: 0; background: rgba(20, 10, 5, .65); animation: fadein .15s; }
.iv-card { position: relative; width: min(94vw, 440px); max-height: 92vh; overflow-y: auto; padding: 14px; border-radius: 20px; background: var(--card); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); text-align: center; animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
.iv-img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.iv-emo { font-size: 6rem; line-height: 1.2; }
.iv-title { margin-top: 8px; font-size: 1.25rem; font-weight: 800; }
.iv-card .row { justify-content: center; }
