/* 午飯見 網頁版：像素農莊風格（同小程序一樣，1rpx = 0.5px） */
:root {
  --ink: #2b1d14; --paper: #fff6df; --parch: #f3e6c4; --wood: #b07a45; --wood-d: #7a4f2a;
  --red: #c8463a; --green: #3e8a5a; --sign: #f6d55c; --muted: #7a5a3c;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #5e3b1f; overscroll-behavior: none; }
body {
  color: var(--ink);
  font-family: -apple-system, "PingFang HK", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 14px; line-height: 1.45;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 48px),
    linear-gradient(#6b4527, #4f311a);
}
button, input { font: inherit; color: inherit; }
img { display: block; }

#phone { position: relative; height: 100%; max-width: 480px; margin: 0 auto; overflow: hidden; overflow: clip;background: var(--parch); box-shadow: 0 0 0 3px var(--ink), 0 20px 60px rgba(0,0,0,.45); }
#stack { position: absolute; inset: 0; }

/* ---------- 頁面堆疊 + 轉場 ---------- */
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--parch); will-change: transform; }
.page-body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; position: relative; }
.page.in-right { animation: inRight .42s var(--ease-out) both; }
.page.out-left { animation: outLeft .42s var(--ease-out) both; }
.page.in-left { animation: inLeft .42s var(--ease-out) both; }
.page.out-right { animation: outRight .38s var(--ease-out) both; z-index: 5; }
.page.fade-in { animation: fadeUp .45s var(--ease-out) both; }
.page.hidden { visibility: hidden; }
@keyframes inRight { from { transform: translateX(100%); box-shadow: -8px 0 24px rgba(0,0,0,.25); } to { transform: none; box-shadow: -8px 0 24px rgba(0,0,0,0); } }
@keyframes outLeft { to { transform: translateX(-28%); filter: brightness(.82); } }
@keyframes inLeft { from { transform: translateX(-28%); filter: brightness(.82); } to { transform: none; filter: none; } }
@keyframes outRight { to { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 頂部導航（等同小程序導航欄） */
.navbar { flex-shrink: 0; position: relative; z-index: 20; display: flex; align-items: center; justify-content: center; height: calc(46px + var(--safe-t)); padding-top: var(--safe-t); background: var(--wood-d); color: #fff; border-bottom: 3px solid var(--ink); }
.nav-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 2px 2px 0 var(--ink); }
.nav-back { position: absolute; left: 6px; bottom: 5px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #fff; font-size: 26px; cursor: pointer; transition: transform .15s; }
.nav-back:active { transform: translateX(-3px); }
.nav-install { position: absolute; right: 8px; bottom: 8px; height: 30px; padding: 0 8px; display: flex; align-items: center; gap: 4px; background: var(--sign); color: var(--ink); border: 2px solid var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; animation: wiggle 4s 2s infinite; }
@keyframes wiggle { 0%, 90%, 100% { transform: none; } 92% { transform: rotate(-6deg); } 94% { transform: rotate(6deg); } 96% { transform: rotate(-4deg); } 98% { transform: rotate(3deg); } }

/* ---------- 共用（對應 app.wxss） ---------- */
.px { background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.px-wood { background: var(--wood); border: 3px solid var(--ink); box-shadow: inset 0 -4px 0 var(--wood-d), 3px 3px 0 var(--ink); color: #fff6df; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap { gap: 8px; }
.flex1 { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; }
.mt { margin-top: 8px; }
.mt2 { margin-top: 14px; }
.center { text-align: center; }

.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 42px; padding: 0 14px; cursor: pointer; user-select: none;
  background: var(--green); color: #fff;
  border: 3px solid var(--ink); box-shadow: inset 0 -5px 0 rgba(0,0,0,.22), 3px 3px 0 var(--ink);
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .2s, filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn.red { background: var(--red); }
.btn.yellow { background: var(--sign); color: var(--ink); }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.small { min-height: 32px; font-size: 13px; padding: 0 10px; }
.btn.disabled { background: #cfc3a6; color: #7d6e55; cursor: default; }
.btn:active, .tap:active { transform: translate(2px, 2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.22), 1px 1px 0 var(--ink); }
.btn.disabled:active { transform: none; }
.tap { cursor: pointer; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); }
.btn.shine { position: relative; overflow: hidden; }
.btn.shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); animation: shine 3.6s 1.2s infinite; }
@keyframes shine { 0% { left: -60%; } 30%, 100% { left: 130%; } }

.field { display: block; width: 100%; height: 44px; padding: 0 10px; margin-bottom: 12px; background: #fffdf5; border: 3px solid var(--ink); font-size: 15px; outline: none; border-radius: 0; -webkit-appearance: none; transition: box-shadow .2s, background-color .2s; }
.field:focus { background: #fff; box-shadow: 3px 3px 0 var(--sign), 3px 3px 0 3px var(--ink); }

.tag { display: inline-flex; align-items: center; padding: 1px 7px; border: 2px solid var(--ink); background: var(--paper); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.hot { background: var(--sign); }
.tag.red { background: var(--red); color: #fff; }
.tag.green { background: var(--green); color: #fff; }
.tag.grey { background: #d6ccb4; color: #5b4c38; }
.bump { animation: bump .5s var(--spring); }
@keyframes bump { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: none; } }

.section-title { font-size: 15px; font-weight: 700; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ""; width: 7px; height: 7px; background: var(--red); border: 2px solid var(--ink); }
.empty { text-align: center; padding: 20px 12px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; margin: 0 5px 5px 0; background: #fffdf5; border: 2px solid var(--ink); font-size: 12px; animation: popIn .35s var(--spring) both; }
.chip.host .dot { background: var(--red); }
.chip.with-av { padding-left: 2px; }

.av { width: 26px; height: 26px; border: 2px solid var(--ink); background: var(--sign); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 48px; height: 48px; font-size: 20px; border-width: 3px; }
.av.sm { width: 20px; height: 20px; font-size: 10px; }
.av-stack { display: flex; align-items: center; }
.av-stack .av { margin-right: -5px; animation: popIn .4s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
.av-more { margin-left: 9px; font-size: 11px; color: var(--muted); }
@keyframes popIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }

.card { padding: 12px; margin-bottom: 12px; }
.enter { animation: cardIn .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 地圖頁 ---------- */
.page-wrap { padding: 10px 10px 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; margin-bottom: 10px; }
.group-btn { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; min-height: 32px; cursor: pointer; }
.group-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 2px 2px 0 var(--ink); }
.caret { font-size: 12px; transition: transform .2s; }
.group-btn:active .caret { transform: translateY(2px); }
.slot-switch { position: relative; display: flex; border: 3px solid var(--ink); background: #5e3b1f; flex-shrink: 0; }
.slot-thumb { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--sign); box-shadow: inset 0 -4px 0 #d9a43a; transition: transform .35s var(--spring); }
.slot-switch.dinner .slot-thumb { transform: translateX(100%); }
.slot { position: relative; min-width: 54px; min-height: 32px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #f3e6c4; padding: 0 6px; cursor: pointer; transition: color .25s; }
.slot.on { color: var(--ink); }

.members-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 10px; cursor: pointer; }
.members-text { margin-left: 6px; }

.welcome .big { font-size: 17px; }

.map { position: relative; width: 100%; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); margin-bottom: 12px; overflow: hidden; background: #6caa4c; touch-action: manipulation; }
.map-img { display: block; width: 100%; image-rendering: pixelated; animation: mapIn .9s var(--ease-out) both; }
@keyframes mapIn { from { filter: saturate(.3) brightness(1.2); transform: scale(1.04); } to { filter: none; transform: none; } }
.area-label { position: absolute; transform: translate(-50%, -50%); padding: 1px 6px; background: rgba(43,29,20,.72); color: #fff6df; font-size: 11px; line-height: 16px; white-space: nowrap; pointer-events: none; letter-spacing: 1px; animation: fadeIn .6s .3s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.map-note { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; background: rgba(255,246,223,.85); font-size: 10px; color: #5b4c38; z-index: 6; }

/* 雲影慢慢飄過 */
.cloud { position: absolute; z-index: 5; pointer-events: none; width: 60px; height: 14px; background: rgba(255,255,255,.55); box-shadow: 14px -8px 0 -1px rgba(255,255,255,.55), 30px -4px 0 0 rgba(255,255,255,.5); opacity: .8; animation: drift linear infinite; }
.cloud.c1 { top: 18%; animation-duration: 46s; animation-delay: -12s; }
.cloud.c2 { top: 55%; animation-duration: 64s; animation-delay: -40s; transform: scale(.7); }
.cloud.c3 { top: 82%; animation-duration: 54s; animation-delay: -5s; }
@keyframes drift { from { left: -90px; } to { left: 105%; } }
.shadow-cloud { position: absolute; z-index: 1; pointer-events: none; width: 120px; height: 50px; background: rgba(20, 40, 10, .12); filter: blur(6px); animation: drift 70s linear infinite; animation-delay: -30s; top: 35%; }

/* 餐廳招牌 */
.marker { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; z-index: 2; padding: 4px; cursor: pointer; }
.marker.align-left { transform: translate(-18%, -100%); align-items: flex-start; }
.marker.align-right { transform: translate(-82%, -100%); align-items: flex-end; }
.marker.sel { z-index: 4; }
.marker .mk-in { display: flex; flex-direction: column; align-items: inherit; animation: drop .7s var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms); transform-origin: 50% 100%; transition: transform .25s var(--spring); }
.marker:active .mk-in { transform: scale(.92); }
.marker.sel .mk-in { transform: scale(1.12); }
@keyframes drop { 0% { opacity: 0; transform: translateY(-40px) scaleY(1.1); } 55% { opacity: 1; transform: translateY(0) scaleY(.88); } 75% { transform: translateY(-5px) scaleY(1.04); } 100% { transform: none; } }
.sign { position: relative; min-width: 56px; min-height: 30px; padding: 4px 8px; background: #c8955a; border: 2px solid var(--ink); box-shadow: inset 0 -3px 0 #8a5a30, 2px 2px 0 var(--ink); text-align: center; }
.sign-name { font-size: 12px; line-height: 16px; font-weight: 700; color: #fff6df; white-space: nowrap; text-shadow: 1px 1px 0 var(--ink); }
.post { width: 4px; height: 8px; background: #6b4a2b; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.marker.align-left .post { margin-left: 14px; }
.marker.align-right .post { margin-right: 14px; }
.marker.hot { z-index: 3; }
.marker.hot .sign { background: var(--sign); box-shadow: inset 0 -3px 0 #d9a43a, 3px 3px 0 var(--ink); border-width: 3px; padding: 3px 6px; animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -300ms); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.marker.hot .sign-name { color: var(--ink); text-shadow: none; }
.sign-time { font-size: 14px; line-height: 18px; font-weight: 800; color: #b3261e; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sign-more { position: absolute; top: -10px; right: -10px; padding: 0 4px; background: var(--red); color: #fff; border: 2px solid var(--ink); font-size: 11px; line-height: 15px; font-weight: 700; animation: popIn .4s .5s var(--spring) both; }
.sign-me { position: absolute; top: -10px; left: -10px; width: 18px; height: 18px; background: var(--green); color: #fff; border: 2px solid var(--ink); font-size: 11px; line-height: 14px; text-align: center; font-weight: 700; animation: popIn .4s .5s var(--spring) both; }
.marker.sel .sign { outline: 3px solid #fff6df; }
/* 熱氣：有飯局嘅招牌冒煙 */
.steam { position: absolute; top: -14px; left: 50%; width: 3px; height: 8px; background: rgba(255,255,255,.9); opacity: 0; animation: steam 2s ease-out infinite; pointer-events: none; }
.steam.s2 { margin-left: -9px; animation-delay: .7s; }
.steam.s3 { margin-left: 8px; animation-delay: 1.3s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px) translateX(3px); } }

/* 冇飯局嘅餐廳：細圖釘 */
.pin { position: absolute; transform: translate(-50%, -50%); padding: 10px; z-index: 1; cursor: pointer; }
.pin-dot { position: relative; width: 10px; height: 10px; background: #fff6df; border: 2px solid var(--red); box-shadow: 0 0 0 2px var(--ink), 2px 2px 0 2px var(--ink); animation: popIn .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 40ms + 200ms); transition: transform .2s var(--spring); }
.pin:hover .pin-dot { transform: scale(1.4); }
.pin-dot::after { content: ""; position: absolute; inset: -4px; border: 2px solid rgba(255,246,223,.9); animation: ping 2.8s ease-out infinite; animation-delay: calc(var(--i, 0) * 230ms); }
@keyframes ping { 0% { opacity: .9; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(2.2); } }

.avatar-tip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 10px; cursor: pointer; }
.tools { display: flex; gap: 8px; margin-bottom: 12px; }
.dice { display: inline-block; margin-right: 4px; }
.tools .btn:hover .dice, .tools .btn:active .dice { animation: roll .6s var(--ease-out); }
@keyframes roll { to { transform: rotate(360deg); } }

/* 飯局面板 */
.sheet { animation: sheetIn .45s var(--ease-out) both; scroll-margin-top: 8px; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 15px; border: 3px solid var(--ink); background: #fffdf5; cursor: pointer; transition: transform .25s var(--spring); }
.close:hover { transform: rotate(90deg); }
.r-name { font-size: 19px; font-weight: 800; }
.addr { margin-top: 7px; padding: 7px 8px; background: #f6ecd2; border: 2px dashed var(--wood); font-size: 13px; }
.meal { margin-top: 9px; padding: 10px; background: #fffdf5; border: 3px solid var(--ink); animation: cardIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
.meal-time { font-size: 22px; font-weight: 800; color: #b3261e; }
.meal-line { margin-top: 4px; font-size: 14px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 2px dashed #d3bf95; min-height: 44px; cursor: pointer; animation: cardIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); transition: background-color .2s; }
.list-row:hover { background: rgba(246,213,92,.18); }
.list-row:first-of-type { border-top: none; }
.list-time { font-size: 15px; color: #b3261e; }
.host-av { align-self: flex-start; }
.r-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bottom-space { height: 90px; }
.bottombar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 10px; padding: 9px 12px calc(9px + var(--safe-b)); background: var(--wood-d); border-top: 3px solid var(--ink); animation: barIn .5s .15s var(--ease-out) both; }
@keyframes barIn { from { transform: translateY(100%); } to { transform: none; } }

/* 加到桌面橫幅 */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--sign); animation: cardIn .5s .4s var(--ease-out) both; }
.install-banner .ib-icon { width: 36px; height: 36px; border: 2px solid var(--ink); image-rendering: pixelated; animation: hop 2.2s 1s ease-in-out infinite; }
@keyframes hop { 0%, 80%, 100% { transform: none; } 85% { transform: translateY(-6px); } 90% { transform: none; } 94% { transform: translateY(-3px); } }
.ib-x { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; }

/* ---------- 發起頁 ---------- */
.p-create { padding: 12px 12px 40px; }
.p-create .card { margin-bottom: 14px; }
.label { font-size: 15px; font-weight: 800; margin-bottom: 9px; }
.r-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.r-opt { width: calc(50% - 4px); padding: 8px; min-height: 48px; background: #fffdf5; border: 3px solid var(--ink); cursor: pointer; transition: background-color .2s, transform .2s var(--spring), box-shadow .2s; animation: popIn .35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 25ms); }
.r-opt:active { transform: scale(.96); }
.r-opt.on { background: var(--sign); box-shadow: inset 0 -4px 0 #d9a43a; transform: translateY(-2px); }
.seg { position: relative; display: flex; border: 3px solid var(--ink); margin-bottom: 9px; background: #fffdf5; }
.seg-thumb { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--wood-d); transition: transform .35s var(--spring); }
.seg.dinner .seg-thumb { transform: translateX(100%); }
.seg-item { position: relative; flex: 1; min-height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; transition: color .25s; }
.seg-item.on { color: #fff6df; }
.t-grid { display: flex; gap: 7px; margin-bottom: 8px; }
.t-opt { flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; background: #fffdf5; border: 3px solid var(--ink); cursor: pointer; transition: background-color .2s, transform .25s var(--spring); }
.t-opt.on { background: var(--sign); transform: translateY(-2px); box-shadow: 2px 2px 0 var(--ink); }
.t-opt.past { color: #b8ab90; border-color: #b8ab90; text-decoration: line-through; cursor: not-allowed; }
.t-custom { position: relative; min-height: 40px; display: flex; align-items: center; justify-content: center; border: 3px dashed var(--wood-d); font-weight: 700; color: var(--wood-d); cursor: pointer; }
.t-custom.on { border-style: solid; border-color: var(--ink); background: var(--sign); color: var(--ink); }
.t-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.big-btn { min-height: 50px; font-size: 17px; }
.area-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.seg-chip { padding: 4px 8px; border: 3px solid var(--ink); background: #fffdf5; font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s, transform .2s var(--spring); }
.seg-chip:active { transform: scale(.94); }
.seg-chip.on { background: var(--wood-d); color: #fff6df; }
.seg-chip.y.on { background: var(--sign); color: var(--ink); box-shadow: inset 0 -4px 0 #d9a43a; }

/* ---------- 我的飯局 ---------- */
.p-mine { padding: 2px 12px 40px; }
.p-mine .card { margin-bottom: 14px; }
.m-time { font-size: 24px; font-weight: 800; color: #b3261e; }
.m-time.strike { text-decoration: line-through; color: #9b8b70; }
.m-name { font-size: 17px; font-weight: 800; }
.update { margin-top: 8px; padding: 8px; background: #fff1b8; border: 3px solid var(--ink); animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(246,213,92,0); } 50% { box-shadow: 0 0 0 4px rgba(246,213,92,.7); } }

/* ---------- 約飯團 ---------- */
.p-groups { padding: 2px 12px 40px; }
.g-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; min-height: 48px; cursor: pointer; animation: cardIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.me-card { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.m-grid { display: flex; flex-wrap: wrap; margin-top: 8px; }
.m-cell { width: 25%; display: flex; flex-direction: column; align-items: center; padding: 6px 0; animation: popIn .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms); }
.m-name { font-size: 12px; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.m-tag { margin-top: 3px; font-size: 10px; }
.g-title { font-size: 18px; font-weight: 800; }
.m-kick { margin-top: 3px; font-size: 11px; padding: 1px 6px; border: 2px solid var(--red); color: var(--red); background: #fffdf5; cursor: pointer; transition: background-color .2s, color .2s; }
.m-kick:hover { background: var(--red); color: #fff; }
.leave { color: var(--red); margin-bottom: 4px; }

/* ---------- 加入頁 ---------- */
.p-join { padding: 12px; }
.hero { position: relative; width: 100%; height: 180px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); margin-bottom: 14px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; animation: kenburns 18s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.25) translate(-4%, -6%); } }
.p-join .card { padding: 16px 14px; }
.g-name { font-size: 22px; font-weight: 800; margin: 4px 0 6px; }

/* ---------- 轉盤 ---------- */
.p-roulette { padding: 10px 12px 40px; }
.wheel-box { position: relative; width: min(300px, 80vw); height: min(300px, 80vw); margin: 26px auto 8px; }
.wheel-canvas { width: 100%; height: 100%; display: block; }
.bulbs { position: absolute; inset: -12px; pointer-events: none; }
.bulb { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff1b8; border: 2px solid var(--ink); animation: blink 1s steps(1) infinite; }
.bulb:nth-child(2n) { animation-delay: .5s; }
.spinning .bulb { animation-duration: .2s; }
@keyframes blink { 0% { background: #fff1b8; box-shadow: 0 0 8px 2px rgba(255,220,90,.9); } 50% { background: #b8a77a; box-shadow: none; } }
.pointer { position: absolute; left: 50%; top: -14px; z-index: 3; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 22px solid var(--red); filter: drop-shadow(2px 2px 0 var(--ink)); transform-origin: 50% 0; }
.pointer.tick { animation: tick .12s ease-out; }
@keyframes tick { 40% { transform: rotate(-22deg); } 100% { transform: none; } }
.hub { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: #fff6df; border: 4px solid var(--ink); box-shadow: inset 0 -6px 0 #d3bf95, 3px 3px 0 var(--ink); font-size: 20px; font-weight: 800; cursor: pointer; transition: transform .2s var(--spring); }
.hub:hover { transform: translate(-50%, -50%) scale(1.08); }
.hub:active { transform: translate(-50%, -50%) scale(.94); }
.hub.idle { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: inset 0 -6px 0 #d3bf95, 3px 3px 0 var(--ink), 0 0 0 0 rgba(246,213,92,.0); } 50% { box-shadow: inset 0 -6px 0 #d3bf95, 3px 3px 0 var(--ink), 0 0 0 8px rgba(246,213,92,.55); } }
.result { padding: 12px; margin-top: 16px; animation: flipIn .6s var(--spring) both; transform-origin: 50% 0; }
@keyframes flipIn { from { opacity: 0; transform: perspective(600px) rotateX(-70deg); } to { opacity: 1; transform: none; } }
.result .r-name { font-size: 22px; }

/* ---------- 餐廳頁 ---------- */
.p-places { padding: 10px 12px 40px; }
.pickmap { position: relative; border: 3px solid var(--ink); margin-bottom: 4px; overflow: hidden; cursor: crosshair; }
.pickmap img { width: 100%; image-rendering: pixelated; }
.pickpin { position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%); background: var(--red); border: 3px solid #fff6df; box-shadow: 0 0 0 2px var(--ink); animation: pinDrop .5s var(--spring); }
@keyframes pinDrop { from { transform: translate(-50%, -260%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.pickpin::after { content: ""; position: absolute; inset: -8px; border: 2px solid #fff6df; animation: ping 1.6s ease-out infinite; }
.list { padding: 2px 12px; }
.r-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 2px dashed #d3bf95; animation: cardIn .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
.r-row:first-child { border-top: none; }
.tag.mini { margin-left: 5px; font-size: 10px; padding: 0 4px; }
.form-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.note { margin-bottom: 8px; }

/* ---------- 浮層：toast / loading / modal / sheet ---------- */
#overlay { position: absolute; inset: 0; pointer-events: none; z-index: 100; }
.toast { position: absolute; left: 50%; top: 42%; max-width: 78%; padding: 10px 16px; background: rgba(43,29,20,.92); color: #fff6df; border: 3px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.3); font-weight: 700; text-align: center; transform: translate(-50%, -50%); animation: toastIn .4s var(--spring) both; z-index: 130; }
.toast.out { animation: toastOut .25s ease-in both; }
.toast .t-icon { display: block; font-size: 30px; margin-bottom: 2px; animation: bump .5s .1s var(--spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -60%) scale(.9); } }

.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(243,230,196,.35); animation: fadeIn .2s both; z-index: 120; }
.loading-box { padding: 14px 18px; background: rgba(43,29,20,.9); color: #fff6df; border: 3px solid var(--ink); text-align: center; font-weight: 700; min-width: 110px; }
.bowl { position: relative; width: 34px; height: 18px; margin: 10px auto 8px; background: var(--red); border: 3px solid #fff6df; border-top-width: 0; border-radius: 0 0 16px 16px; }
.bowl::before { content: ""; position: absolute; left: -6px; right: -6px; top: -5px; height: 5px; background: #fff6df; }
.bowl i { position: absolute; top: -18px; width: 3px; height: 8px; background: #fff6df; animation: steam 1.2s ease-out infinite; opacity: 0; }
.bowl i:nth-child(1) { left: 6px; } .bowl i:nth-child(2) { left: 15px; animation-delay: .4s; } .bowl i:nth-child(3) { left: 24px; animation-delay: .8s; }

.mask { position: absolute; inset: 0; pointer-events: auto; background: rgba(43,29,20,.55); display: flex; align-items: center; justify-content: center; padding: 0 24px; animation: fadeIn .25s both; z-index: 110; }
.mask.out { animation: fadeOut .2s both; }
@keyframes fadeOut { to { opacity: 0; } }
.modal { width: 100%; padding: 18px 16px; animation: modalIn .45s var(--spring) both; }
.mask.out .modal { animation: modalOut .2s ease-in both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-30px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(16px) scale(.95); } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-hint { font-size: 13px; color: var(--muted); margin-bottom: 12px; white-space: pre-line; }
.av-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.av-btn { position: relative; width: 64px; height: 64px; padding: 0; border: 3px solid var(--ink); background: #fffdf5; overflow: hidden; cursor: pointer; flex-shrink: 0; transition: transform .2s var(--spring); }
.av-btn:hover { transform: rotate(-3deg) scale(1.05); }
.av-btn img { width: 100%; height: 100%; object-fit: cover; animation: popIn .4s var(--spring); }
.av-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.av-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--wood-d); }
.av-tip { font-size: 13px; color: var(--muted); }

.sheet-mask { position: absolute; inset: 0; pointer-events: auto; background: rgba(43,29,20,.55); animation: fadeIn .25s both; z-index: 110; }
.sheet-mask.out { animation: fadeOut .25s both; }
.bsheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(18px + var(--safe-b)); background: var(--paper); border-top: 3px solid var(--ink); animation: sheetUp .45s var(--ease-out) both; }
.sheet-mask.out .bsheet { animation: sheetDown .25s ease-in both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.steps { margin: 10px 0 14px; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 8px 0 8px 36px; font-size: 14px; animation: cardIn .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 6px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: var(--sign); border: 2px solid var(--ink); font-weight: 800; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 5px; border: 2px solid var(--ink); background: #fffdf5; font-weight: 800; }
.point-down { position: absolute; left: 50%; bottom: calc(-38px - var(--safe-b)); margin-left: -12px; font-size: 26px; animation: pointDown 1s ease-in-out infinite; }
@keyframes pointDown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.point-up { position: absolute; right: 18px; top: calc(4px + var(--safe-t)); font-size: 26px; animation: pointUp 1s ease-in-out infinite; z-index: 2; }
@keyframes pointUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 彩紙 */
.confetti { position: absolute; top: 0; width: 8px; height: 8px; z-index: 125; pointer-events: none; animation: fall var(--d, 1.6s) cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x, 0), var(--y, 500px)) rotate(var(--r, 540deg)); opacity: 0; } }

/* 下拉刷新 */
.ptr { position: absolute; left: 0; right: 0; top: 0; height: 0; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; z-index: 15; pointer-events: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.ptr .bowl { border-color: var(--ink); margin: 0 0 6px; transform: scale(.8); }
.ptr .bowl::before { background: var(--ink); }
.ptr .bowl i { background: var(--muted); }

/* 啟動畫面 */
#splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--parch); transition: opacity .4s, visibility .4s; }
#splash.gone { opacity: 0; visibility: hidden; }
.splash-bowl { width: 96px; height: 96px; background: url(/icons/icon-192.png) center/contain no-repeat; image-rendering: pixelated; animation: hop 1.2s ease-in-out infinite; }
.splash-t { font-size: 22px; font-weight: 800; letter-spacing: 4px; }

/* ================= 平板（≥ 600px） ================= */
@media (min-width: 600px) {
  #phone { max-width: 820px; }
  .r-opt { width: calc(33.33% - 6px); }
  .m-cell { width: 20%; }
  .modal { max-width: 440px; }
  .m-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .m-list .card { margin-bottom: 0; }
  .pickmap { max-width: 460px; }
  .hero { height: 240px; }
  .wheel-box { width: 340px; height: 340px; }
  .p-create, .p-mine, .p-groups, .p-places, .p-roulette, .p-join { padding-left: 20px; padding-right: 20px; }
}

/* ================= 電腦（≥ 960px）：地圖左、資料右 ================= */
@media (min-width: 960px) {
  body { font-size: 15px; }
  #phone { max-width: 1280px; box-shadow: 0 0 0 3px var(--ink), 0 30px 80px rgba(0,0,0,.5); }
  .navbar { height: 56px; }
  .nav-title { font-size: 19px; letter-spacing: 2px; }
  .nav-back { left: 14px; bottom: 9px; }
  .nav-install { right: 16px; bottom: 12px; height: 32px; padding: 0 12px; font-size: 13px; }

  /* 地圖頁：兩欄，地圖固定喺左邊 */
  .page-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, 1fr); column-gap: 28px; align-items: start; padding: 22px 28px 0; }
  .page-wrap > * { grid-column: 2; }
  .page-wrap > .map { grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 22px; justify-self: center; width: min(100%, calc((100vh - 140px) * .75)); margin-bottom: 22px; }
  .page-wrap > .bottom-space { height: 110px; }
  .marker .sign-name { font-size: 13px; }
  .sign-time { font-size: 15px; }
  .bottombar { left: auto; right: 28px; bottom: 18px; width: min(460px, 42%); padding: 10px 12px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); animation-name: barInD; }
  @keyframes barInD { from { transform: translateY(140%); } to { transform: none; } }

  /* 其他頁：置中，唔好拉太闊 */
  .p-create, .p-mine, .p-groups, .p-places, .p-roulette, .p-join { max-width: 880px; margin: 0 auto; padding-top: 22px; }
  .r-opt { width: calc(25% - 6px); }
  .m-cell { width: 16.66%; }
  .wheel-box { width: 400px; height: 400px; margin-top: 34px; }
  .hero { height: 300px; }

  /* 底部抽屜喺電腦變成置中對話框 */
  .bsheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding-bottom: 18px; transform: translate(-50%, -50%); animation: dlgIn .4s var(--spring) both; }
  .sheet-mask.out .bsheet { animation: dlgOut .2s ease-in both; }
  @keyframes dlgIn { from { opacity: 0; transform: translate(-50%, -42%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }
  @keyframes dlgOut { to { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
  .point-down, .point-up { display: none; }
  .ptr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cloud, .shadow-cloud, .steam { display: none; }
}
