/* 深夜便利商店 — 介面樣式 */
:root {
  --ink: #2b2233;
  --cream: #fff6e5;
  --paper: #fffdf7;
  --green: #2fa36b;
  --green-d: #1f7a50;
  --orange: #f28c28;
  --blue: #2a6fdb;
  --red: #e04a3f;
  --yellow: #ffd23f;
  --lcd: #0e2b22;
  --lcd-t: #8ff5c9;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-b: "M PLUS Rounded 1c", "Hiragino Sans", "PingFang TC", sans-serif;
  --font-px: "DotGothic16", "Osaka-Mono", "Menlo", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07081a; overflow: hidden; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
kbd { font-family: var(--font-px); font-size: 10px; padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.18); margin-left: 6px; vertical-align: middle; }

#game { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: center center; overflow: hidden; background: #111; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#scene { position: absolute; inset: 0; width: 1280px; height: 720px; display: block; }

/* ---------------- HUD ---------------- */
#hud { position: absolute; left: 0; right: 0; top: 0; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; pointer-events: none; z-index: 20;
  background: linear-gradient(180deg, rgba(20,16,40,.72), rgba(20,16,40,0)); }
#hud > * { pointer-events: auto; }
.hud-l, .hud-r, .hud-c { display: flex; align-items: center; gap: 10px; }
.hud-c { position: absolute; left: 50%; transform: translateX(-50%); }
.hud-day { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 2px 10px 3px; text-align: center; line-height: 1; box-shadow: 0 3px 0 var(--ink); }
.hud-day small { display: block; font: 800 9px var(--font-b); letter-spacing: 2px; color: #8a7f95; margin-top: 3px; }
.hud-day b { font: 900 22px var(--font-b); }
.hud-clock { background: #0f1c2e; border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px 12px; color: #9ff7d0; display: flex; align-items: baseline; gap: 10px; box-shadow: 0 3px 0 var(--ink), inset 0 0 12px rgba(120,255,200,.15); }
.hud-clock b { font: 400 26px var(--font-px); letter-spacing: 1px; text-shadow: 0 0 8px rgba(120,255,200,.6); }
.hud-clock span { color: #e8f0ff; font-size: 14px; font-weight: 700; }
.hud-bar { width: 120px; height: 8px; background: rgba(255,255,255,.2); border-radius: 6px; overflow: hidden; border: 1.5px solid rgba(0,0,0,.4); }
.hud-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb35c, #9d7bff, #2e3a8c, #ff9ac1); background-size: 120px 100%; }
.hud-money { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; padding: 2px 14px 2px 10px; font: 900 26px var(--font-b); box-shadow: 0 3px 0 var(--ink); position: relative; min-width: 150px; text-align: right; }
.hud-money .yen { color: var(--green); margin-right: 2px; }
.hud-money em { position: absolute; right: 8px; top: 100%; font: 900 15px var(--font-b); font-style: normal; animation: mdelta 1.4s ease-out forwards; opacity: 0; text-shadow: 0 1px 0 #fff, 0 -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff; }
.hud-money em.up { color: var(--green); }
.hud-money em.down { color: var(--red); }
@keyframes mdelta { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }
.hud-rep { display: flex; align-items: center; gap: 1px; background: rgba(20,16,40,.55); padding: 4px 10px; border-radius: 12px; }
.hud-rep .star { position: relative; color: rgba(255,255,255,.25); font-size: 20px; line-height: 1; }
.hud-rep .star i { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--yellow); font-style: normal; text-shadow: 0 0 6px rgba(255,210,63,.6); }
.hud-rep small { color: #fff; font: 800 12px var(--font-b); margin-left: 6px; }
.speed { display: flex; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.speed button { padding: 6px 9px; font: 900 11px var(--font-b); letter-spacing: -2px; color: #8a7f95; border-right: 1.5px solid #e6dccb; }
.speed button:last-child { border-right: 0; }
.speed button.on { background: var(--green); color: #fff; }
.speed button:hover:not(.on) { background: #f3ead8; }
.hud-btn { width: 46px; height: 42px; font-size: 22px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); position: relative; }
.hud-btn:hover { transform: translateY(-1px); }
.hud-btn i { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font: 900 11px/20px var(--font-b); font-style: normal; border: 2px solid #fff; }
.phone-btn.buzz { animation: buzz .5s ease-in-out 2; }
@keyframes buzz { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }

/* ---------------- 缺貨警示 ---------------- */
#alerts { position: absolute; left: 10px; top: 64px; display: flex; flex-direction: column; gap: 6px; z-index: 15; }
.alert { display: flex; align-items: center; gap: 6px; background: rgba(255,253,247,.94); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px 4px 6px; font-size: 12px; box-shadow: 0 2px 0 var(--ink); animation: slidein .3s ease-out; }
.alert:hover { transform: translateX(3px); }
.alert span { font-size: 16px; }
.alert b { font-weight: 800; }
.alert i { width: 46px; height: 6px; background: #e8dfcf; border-radius: 4px; overflow: hidden; }
.alert i u { display: block; height: 100%; background: var(--orange); }
.alert em { font-style: normal; background: var(--red); color: #fff; border-radius: 6px; padding: 0 5px; font-weight: 800; font-size: 11px; }
.alert.bad { border-color: var(--red); animation: slidein .3s ease-out, pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 2px 0 var(--red), 0 0 0 4px rgba(224,74,63,.2); } }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0; } }

/* ---------------- toast ---------------- */
#toasts { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 40; pointer-events: none; }
.toast { background: rgba(30,24,48,.92); color: #fff; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: tin .3s cubic-bezier(.2,1.4,.4,1); white-space: nowrap; }
.toast.gold { background: linear-gradient(135deg, #ffd23f, #f28c28); color: var(--ink); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .35s; }
@keyframes tin { from { transform: translateY(-14px) scale(.9); opacity: 0; } }

/* ---------------- 櫃台商品 ---------------- */
#counterItems { position: absolute; left: 440px; top: 598px; width: 350px; height: 100px; z-index: 12; }
.citem { position: absolute; width: 50px; height: 50px; padding: 0; transform: rotate(var(--rot)); transition: transform .12s, filter .12s; filter: drop-shadow(0 3px 2px rgba(60,30,10,.35)); }
.citem img { width: 100%; height: 100%; display: block; pointer-events: none; }
.citem:hover { transform: rotate(0) scale(1.18) translateY(-4px); filter: drop-shadow(0 6px 4px rgba(60,30,10,.35)) brightness(1.08); z-index: 50 !important; }
.scanbeam { position: absolute; width: 60px; height: 50px; background: linear-gradient(90deg, transparent, rgba(255,40,40,.6), transparent); animation: beam .3s linear; pointer-events: none; z-index: 60; }
@keyframes beam { from { transform: translateY(-10px); opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

/* ---------------- POS 面板 ---------------- */
#pos { position: absolute; right: 10px; top: 208px; width: 364px; bottom: 8px; z-index: 25; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #2c3038, #1d2026); border: 3px solid var(--ink); border-radius: 18px; padding: 10px; color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
  transform: translateX(400px); transition: transform .35s cubic-bezier(.2,1.2,.4,1); }
#pos.show { transform: translateX(0); }
.pos-head { display: flex; align-items: center; gap: 10px; }
.pos-av { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #3a3f48; border: 2px solid #fff; display: grid; place-items: center; font-size: 24px; flex: none; }
.pos-av img { width: 100%; height: 100%; }
.pos-who { flex: 1; }
.pos-who b { font-size: 15px; }
.patience { height: 7px; background: rgba(255,255,255,.15); border-radius: 5px; overflow: hidden; margin-top: 5px; }
.patience i { display: block; height: 100%; border-radius: 5px; transition: width .2s; }
.pos-pay-ic { font-size: 12px; font-weight: 800; background: rgba(255,255,255,.12); padding: 3px 8px; border-radius: 8px; }
.pos-pay-ic:empty { display: none; }
.pos-lcd { background: var(--lcd); border-radius: 10px; border: 2px solid #0a1712; padding: 8px 10px; font-family: var(--font-px); color: var(--lcd-t); flex: 1; min-height: 110px; display: flex; flex-direction: column; box-shadow: inset 0 0 20px rgba(0,0,0,.6);
  background-image: repeating-linear-gradient(0deg, rgba(143,245,201,.05) 0 1px, transparent 1px 3px); }
.lcd-lines { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 14px; }
.lcd-l { display: flex; justify-content: space-between; animation: lcdin .2s; }
.lcd-l em { font-style: normal; color: #ffd98a; }
@keyframes lcdin { from { opacity: 0; transform: translateX(-8px); } }
.lcd-empty { color: rgba(143,245,201,.55); text-align: center; margin: auto; line-height: 1.6; font-family: var(--font); font-size: 13px; }
.lcd-total { border-top: 1px dashed rgba(143,245,201,.4); margin-top: 6px; padding-top: 4px; display: flex; justify-content: space-between; align-items: baseline; }
.lcd-total b { font-size: 26px; font-weight: 400; text-shadow: 0 0 8px rgba(143,245,201,.5); }
.pos-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.act { display: flex; align-items: center; gap: 6px; background: #f3efe6; color: var(--ink); border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 13px; border: 2px solid var(--ink); box-shadow: 0 3px 0 #0006; position: relative; overflow: hidden; }
.act:hover:not(.done):not(.busy) { transform: translateY(-1px); background: #fff; }
.act:active { transform: translateY(2px); box-shadow: 0 1px 0 #0006; }
.act img { width: 26px; height: 26px; }
.act.hot { background: #ffe9a8; animation: glowp 1.2s ease-in-out infinite; }
.act.done { background: #bfe8cf; color: #1f6b43; }
.act.bad { background: #ffd0cb; color: #9b2a20; }
.act.ask { background: #e2e8ff; }
.act.special { background: linear-gradient(135deg, #ffe0f0, #e8dcff); }
.act.tanuki { background: linear-gradient(135deg, #e9d7b8, #c9a77a); }
.act.busy { background: #ffd8a8; }
.mwbar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--orange); }
@keyframes glowp { 50% { box-shadow: 0 3px 0 #0006, 0 0 0 4px rgba(255,210,63,.35); } }
.pos-go { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: 12px; background: linear-gradient(180deg, #3ccf82, #1f9e5a); color: #fff; font: 900 20px var(--font-b); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 #0a3d24; }
.pos-go b { font-weight: 900; }
.pos-go:hover:not(.disabled) { filter: brightness(1.06); }
.pos-go:active:not(.disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0a3d24; }
.pos-go.disabled { background: #5b616b; box-shadow: 0 4px 0 #2a2d33; color: #b8bec8; }
.pos-done { text-align: center; font: 900 20px var(--font-b); color: #9ff7d0; padding: 16px; }
.pay-card { background: #f3efe6; color: var(--ink); border-radius: 12px; padding: 16px; text-align: center; font-weight: 800; border: 2px solid var(--ink); }
.pay-card.small { padding: 8px; font-size: 13px; }
.pay-big { font-size: 40px; animation: tap 0.6s ease-in-out infinite alternate; }
@keyframes tap { to { transform: translateY(-6px); } }
.pay-cash { background: #f3efe6; color: var(--ink); border-radius: 12px; padding: 8px 10px; border: 2px solid var(--ink); }
.pay-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 13px; }
.pay-row b { font: 900 18px var(--font-b); }
.pay-row b.need { color: var(--blue); }
.pay-row b.ok { color: var(--green); }
.pay-row b.over { color: var(--red); }
.denoms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 6px 0; }
.den { height: 36px; font: 900 13px var(--font-b); border: 2px solid var(--ink); box-shadow: 0 2px 0 #0005; }
.den:active { transform: translateY(2px); box-shadow: none; }
.den.bill { border-radius: 5px; background: linear-gradient(135deg, #d9c9a3, #b9a77f); }
.den.d5000 { background: linear-gradient(135deg, #e3c4d9, #bfa0c9); }
.den.coin { border-radius: 50%; width: 40px; height: 40px; justify-self: center; }
.den.d500 { background: radial-gradient(circle at 35% 30%, #fff4c0, #d6b23e); }
.den.d100, .den.d50 { background: radial-gradient(circle at 35% 30%, #ffffff, #b9c0c8); }
.den.d10 { background: radial-gradient(circle at 35% 30%, #ffd2a8, #b87333); }
.den.d5 { background: radial-gradient(circle at 35% 30%, #fff0b0, #caa53a); }
.den.d1 { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd5dc); font-size: 11px; }
.pay-btns { display: flex; gap: 6px; }
.pay-btns .pos-go { flex: 1; padding: 8px; font-size: 16px; }

/* ---------------- 補貨面板 ---------------- */
#restock { position: absolute; left: 50%; top: 66px; width: 700px; max-height: 500px; transform: translate(-50%, -20px) scale(.96); opacity: 0; pointer-events: none; z-index: 30;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink), 0 20px 50px rgba(0,0,0,.4); display: flex; flex-direction: column; transition: .22s cubic-bezier(.2,1.3,.4,1); }
#restock.show { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.rs-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 2px dashed #e4d9c3; }
.rs-ic { font-size: 24px; }
.rs-head b { font: 900 18px var(--font-b); }
.rs-head small { color: #8a7f95; flex: 1; }
.x { width: 32px; height: 32px; border-radius: 50%; background: #f1e7d4; font-weight: 900; }
.x:hover { background: var(--red); color: #fff; }
.rs-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px 14px; overflow-y: auto; }
.rs-it { position: relative; background: #fff; border: 2px solid #eadfca; border-radius: 12px; padding: 6px; text-align: center; cursor: pointer; transition: .12s; }
.rs-it:hover { border-color: var(--green); transform: translateY(-2px); }
.rs-it.low { border-color: var(--orange); background: #fff7ea; }
.rs-it.empty { border-color: var(--red); background: #fff0ee; }
.rs-it img { width: 52px; height: 52px; }
.rs-it.empty img { filter: grayscale(.8) opacity(.6); }
.rs-nm { font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-bar { height: 5px; background: #eee3d0; border-radius: 3px; overflow: hidden; margin: 3px 0 1px; }
.rs-bar i { display: block; height: 100%; background: var(--green); }
.rs-it.low .rs-bar i { background: var(--orange); }
.rs-q { font: 800 10px var(--font-b); color: #8a7f95; }
.rs-btn { margin-top: 3px; width: 100%; background: var(--green); color: #fff; border-radius: 7px; padding: 3px 0; font-size: 11px; font-weight: 800; }
.rs-btn:disabled { background: #d8d0c0; }
.rs-pop { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: #eee3d0; color: #fff; font-size: 12px; line-height: 20px; }
.rs-pop.on { background: var(--yellow); color: var(--red); }
.rs-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 2px dashed #e4d9c3; }
.rs-all { background: var(--orange); color: #fff; font: 900 15px var(--font-b); padding: 8px 18px; border-radius: 12px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.rs-all:disabled { background: #cfc6b4; }

/* ---------------- 手機 ---------------- */
#phone { position: absolute; right: 30px; top: 22px; width: 330px; height: 676px; z-index: 50; transform: translateY(740px) rotate(4deg); transition: transform .4s cubic-bezier(.2,1.1,.3,1); }
#phone.show { transform: translateY(0) rotate(0); }
.ph-frame { width: 100%; height: 100%; background: #1a1a1f; border-radius: 44px; padding: 12px; box-shadow: 0 0 0 3px #3a3a44, 0 30px 60px rgba(0,0,0,.6), inset 0 0 0 2px #000; }
#phoneScreen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; position: relative; display: flex; flex-direction: column;
  background: radial-gradient(circle at 20% 10%, #3a4a9a 0, transparent 50%), radial-gradient(circle at 90% 80%, #b8508a 0, transparent 45%), linear-gradient(180deg, #121633, #2a1f4a); color: #fff; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 4px; font: 800 12px var(--font-b); position: relative; height: 34px; flex: none; }
.ph-notch { position: absolute; left: 50%; top: 6px; width: 90px; height: 24px; background: #000; border-radius: 14px; transform: translateX(-50%); }
.ph-home-ind { position: absolute; bottom: 7px; left: 50%; width: 110px; height: 4px; background: rgba(255,255,255,.7); border-radius: 3px; transform: translateX(-50%); }
.ph-home { flex: 1; padding: 10px 18px; display: flex; flex-direction: column; }
.ph-widget { background: rgba(255,255,255,.14); backdrop-filter: blur(6px); border-radius: 22px; padding: 14px 16px; margin-bottom: 18px; }
.ph-w-time { font: 400 42px var(--font-px); line-height: 1; }
.ph-w-sub { opacity: .8; font-size: 13px; margin-top: 4px; }
.ph-w-money { font: 900 22px var(--font-b); margin-top: 6px; color: #9ff7d0; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.ph-appic { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; }
.ph-appic span { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; box-shadow: 0 4px 10px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35); position: relative; transition: .15s; }
.ph-appic:hover span { transform: scale(1.08); }
.ph-appic span i { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); font: 900 12px/22px var(--font-b); font-style: normal; border: 2px solid #fff; }
.ph-appic small { font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #0008; }
.ph-dock { margin-top: auto; margin-bottom: 18px; background: rgba(255,255,255,.12); border-radius: 18px; padding: 10px 14px; font-size: 12px; line-height: 1.5; opacity: .9; }
.ph-app { flex: 1; display: flex; flex-direction: column; background: #f6f3ee; color: var(--ink); min-height: 0; }
.ph-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: #fff; border-bottom: 1px solid #e6dfd3; flex: none; }
.ph-top b { font: 900 16px var(--font-b); }
.ph-back { font-size: 28px; line-height: 1; width: 30px; color: var(--green); }
.ph-top span { width: 30px; }
.ph-body { flex: 1; overflow-y: auto; padding: 10px 12px 26px; min-height: 0; }
.ph-body::-webkit-scrollbar { width: 4px; } .ph-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.ph-empty { text-align: center; color: #999; padding: 40px 10px; }
.th { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 4px; border-bottom: 1px solid #ece5d9; }
.th:hover { background: #fff; }
.th-av, .msg-av { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; }
.th-av img, .msg-av img { width: 100%; height: 100%; }
.th-av span, .msg-av span { width: 100%; height: 100%; display: grid; place-items: center; font-size: 20px; color: #fff; font-weight: 900; }
.th-t { flex: 1; min-width: 0; }
.th-t b { display: block; font-size: 14px; }
.th-t small { color: #888; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.th i { background: var(--green); color: #fff; font: 900 11px/20px var(--font-b); min-width: 20px; height: 20px; border-radius: 10px; text-align: center; font-style: normal; }
.th em { font-style: normal; font-size: 10px; color: #aaa; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-day { align-self: center; background: rgba(0,0,0,.08); color: #777; font-size: 10px; font-weight: 800; padding: 2px 10px; border-radius: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-start; animation: lcdin .25s; }
.msg-av { width: 34px; height: 34px; }
.msg-b { background: #fff; border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-size: 13.5px; line-height: 1.55; box-shadow: 0 1px 2px rgba(0,0,0,.08); max-width: 220px; }
.shop-hint { font-size: 12px; color: #7a6f85; margin-bottom: 8px; }
.shop-it { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.shop-it.own { opacity: .65; }
.shop-ic { font-size: 30px; width: 44px; text-align: center; flex: none; }
.shop-t { flex: 1; min-width: 0; }
.shop-t b { display: block; font-size: 14px; }
.shop-t small { display: block; font-size: 11.5px; color: #7a6f85; line-height: 1.45; margin-top: 2px; }
.shop-t em { font-style: normal; font-size: 10px; color: var(--orange); font-weight: 800; }
.shop-buy { background: var(--green); color: #fff; font: 900 12px var(--font-b); padding: 8px 10px; border-radius: 10px; flex: none; min-width: 72px; }
.shop-buy:disabled { background: #d3cbbd; color: #fff; }
.pk-icons { display: flex; gap: 2px; margin-top: 6px; }
.pk-icons img { width: 30px; height: 30px; }
.pk-icons img.sil { filter: brightness(0) opacity(.25); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; padding: 6px; border-radius: 10px; background: #e9e2d6; font-weight: 800; }
.tabs button.on { background: var(--ink); color: #fff; }
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dex-it { background: #fff; border-radius: 10px; padding: 4px 2px; text-align: center; cursor: pointer; }
.dex-it img { width: 48px; height: 48px; }
.dex-it small { display: block; font-size: 9.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-it em { display: block; font-size: 9px; color: #999; font-style: normal; }
.dex-it.lock img { filter: brightness(0) opacity(.2); }
.dex-desc { position: sticky; bottom: -26px; background: var(--ink); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 10px; margin-top: 8px; line-height: 1.5; }
.cust { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 8px; margin-bottom: 8px; }
.cust-av { width: 56px; height: 56px; border-radius: 50%; background: #efe8dc; overflow: hidden; display: grid; place-items: center; font-size: 24px; flex: none; }
.cust-av img { width: 100%; height: 100%; }
.cust-t b { font-size: 14px; }
.cust-t small { display: block; font-size: 11.5px; color: #7a6f85; line-height: 1.45; }
.cust-t em { font-style: normal; font-size: 10px; color: var(--green); font-weight: 800; }
.cust.lock { opacity: .55; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; background: #fff; border-radius: 14px; padding: 10px 10px 22px; }
.bar { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.bar i { position: absolute; bottom: 0; left: 10%; right: 10%; background: #a8d8c0; border-radius: 4px 4px 0 0; }
.bar em { position: absolute; bottom: 0; left: 28%; right: 28%; background: var(--green); border-radius: 3px 3px 0 0; }
.bar small { position: absolute; bottom: -18px; font-size: 10px; color: #999; }
.legend { display: flex; gap: 14px; font-size: 11px; margin: 6px 4px 10px; color: #777; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend .l1 { background: #a8d8c0; } .legend .l2 { background: var(--green); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.stats div { background: #fff; border-radius: 10px; padding: 6px 10px; }
.stats small { display: block; font-size: 10.5px; color: #8a7f95; }
.stats b { font: 900 16px var(--font-b); }
.set label { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-weight: 800; font-size: 13px; }
.set input[type=range] { width: 140px; accent-color: var(--green); }
.set input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); }
.set-keys { background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.8; margin-bottom: 12px; }
.danger { width: 100%; background: #ffe2de; color: var(--red); padding: 10px; border-radius: 12px; font-weight: 900; }

/* ---------------- 全螢幕覆蓋 ---------------- */
.overlay { position: absolute; inset: 0; display: none; z-index: 45; }
.overlay.show { display: flex; align-items: center; justify-content: center; }
button.big { background: linear-gradient(180deg, #ffd23f, #f5a524); color: var(--ink); font: 900 22px var(--font-b); padding: 14px 40px; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); transition: .1s; }
button.big:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
button.big:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
button.ghost { background: rgba(255,253,247,.92); color: var(--ink); font: 800 14px var(--font-b); padding: 10px 16px; border-radius: 14px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
button.ghost:hover:not(:disabled) { background: #fff; }
button.ghost:disabled { opacity: .5; }

.title-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 34px; }
.title-logo { text-align: center; position: relative; animation: logoin 1.2s cubic-bezier(.2,1,.3,1); }
@keyframes logoin { from { opacity: 0; transform: translateY(-20px); filter: blur(6px); } }
.t-moon { width: 56px; height: 56px; border-radius: 50%; background: #ffd23f; margin: 0 auto -6px; box-shadow: 0 0 40px rgba(255,210,63,.7); position: relative; }
.t-moon::after { content: ''; position: absolute; width: 48px; height: 48px; border-radius: 50%; background: #0c1030; left: 18px; top: -8px; }
.title-logo h1 { margin: 0; font: 900 76px var(--font-b); color: #fff; letter-spacing: 6px; line-height: 1.05; text-shadow: 0 0 24px rgba(120,200,255,.6), 0 4px 0 var(--ink), 0 0 2px #000; }
.title-logo h1 span:first-child { color: #9ff7d0; margin-right: 12px; }
.t-en { color: rgba(255,255,255,.85); font: 800 14px var(--font-b); letter-spacing: 4px; margin-top: 8px; text-shadow: 0 2px 6px #000; }
.title-btns { position: absolute; bottom: 90px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.title-tip { position: absolute; bottom: 30px; color: rgba(255,255,255,.75); font-size: 13px; text-shadow: 0 1px 4px #000; }
.overlay.intro { background: rgba(10,8,30,.45); backdrop-filter: blur(2px); }
.intro-card { background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; padding: 26px 34px; width: 420px; text-align: center; box-shadow: 0 8px 0 var(--ink), 0 30px 60px rgba(0,0,0,.4); animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.intro-day { font: 900 56px var(--font-b); line-height: 1; background: linear-gradient(135deg, #2a6fdb, #9d5bd6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-sub { color: #8a7f95; font-weight: 800; margin: 6px 0 14px; }
.intro-row { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1.5px dashed #e8dcc6; font-weight: 700; }
.intro-row b { font: 900 17px var(--font-b); }
.intro-hot { margin-top: 10px; background: #ffe2ef; color: #c2185b; padding: 6px; border-radius: 10px; font-weight: 800; font-size: 13px; }
.intro-tips { margin: 14px 0 18px; background: #eef8f2; color: var(--green-d); padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; font-weight: 700; }

.overlay.summary { background: rgba(20,10,30,.25); }
.receipt { width: 430px; max-height: 690px; overflow-y: auto; background: #fffef9; padding: 18px 26px 16px; font-family: var(--font); position: relative; box-shadow: 0 30px 60px rgba(0,0,0,.45); animation: rcin .7s cubic-bezier(.2,1,.3,1);
  -webkit-mask: radial-gradient(circle at 8px 0, transparent 6px, #000 6.5px) -8px 0 / 16px 51% repeat-x, radial-gradient(circle at 8px 100%, transparent 6px, #000 6.5px) -8px 100% / 16px 51% repeat-x;
  mask: radial-gradient(circle at 8px 0, transparent 6px, #000 6.5px) -8px 0 / 16px 51% repeat-x, radial-gradient(circle at 8px 100%, transparent 6px, #000 6.5px) -8px 100% / 16px 51% repeat-x; }
.receipt::-webkit-scrollbar { width: 0; }
@keyframes rcin { from { transform: translateY(120px); opacity: 0; } }
.rc-head { text-align: center; font-size: 12px; color: #666; line-height: 1.6; }
.rc-logo { font: 900 22px var(--font-b); color: var(--green-d); }
.rc-day { font-family: var(--font-px); font-size: 13px; color: #333; }
.rc-sep { border-top: 2px dashed #ccc; margin: 10px 0; }
.rc-row { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; font-weight: 700; }
.rc-row b { font-family: var(--font-px); font-weight: 400; font-size: 16px; }
.rc-row.dim { color: #999; font-size: 12px; }
.rc-row.big { font-size: 18px; }
.rc-row.big b { font: 900 26px var(--font-b); }
.rc-row.pos b { color: var(--green); } .rc-row.neg b { color: var(--red); }
.rc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.rc-grid div { background: #f5f1e8; border-radius: 8px; padding: 4px; text-align: center; }
.rc-grid small { display: block; font-size: 10px; color: #888; }
.rc-grid b { font: 900 16px var(--font-b); }
.rc-events { font-size: 12.5px; line-height: 1.6; color: #555; }
.rc-events b { display: block; color: var(--ink); margin-bottom: 2px; }
.rc-story { font-size: 13px; color: #6b5b95; font-style: italic; text-align: center; line-height: 1.6; padding: 0 6px; }
.rc-barcode { height: 34px; margin: 12px 30px 8px; background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 4px, #222 4px 5px, transparent 5px 8px, #222 8px 11px, transparent 11px 12px); }
.rc-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rc-btns .big { width: 100%; }

/* ---------------- 手機通知橫幅 ---------------- */
#notifs { position: absolute; right: 12px; top: 64px; width: 330px; display: flex; flex-direction: column; gap: 8px; z-index: 42; }
.notif { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 10px 12px; border-radius: 18px; background: rgba(250,248,255,.93); backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(10,5,30,.35); color: var(--ink); animation: nfin .45s cubic-bezier(.2,1.3,.4,1); }
.notif:hover { background: #fff; }
.notif.out { transform: translateY(-16px); opacity: 0; transition: .4s; }
@keyframes nfin { from { transform: translateY(-40px) scale(.95); opacity: 0; } }
.nf-av { width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none; }
.nf-av img { width: 100%; height: 100%; }
.nf-av span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 20px; }
.nf-t { flex: 1; min-width: 0; }
.nf-h { display: flex; justify-content: space-between; align-items: baseline; }
.nf-h b { font-size: 13px; }
.nf-h small { font-size: 10px; color: #8a7f95; }
.nf-m { font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 第一天教學 */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.howto div { background: #f5efe3; border-radius: 12px; padding: 8px 6px; font-size: 12px; line-height: 1.45; font-weight: 700; }
.howto b { display: block; font-size: 22px; margin-bottom: 2px; }
.intro-fc { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.intro-fc span { background: #eef4ff; border-radius: 10px; padding: 3px 8px; font-size: 12px; font-weight: 800; color: #2a4f9a; }

#pausedBadge { position: absolute; left: 50%; top: 300px; transform: translate(-50%, -50%) scale(.9); background: rgba(20,16,40,.82); color: #fff; font: 900 26px var(--font-b); padding: 14px 30px; border-radius: 20px; text-align: center; opacity: 0; pointer-events: none; transition: .2s; z-index: 22; letter-spacing: 2px; }
#pausedBadge small { display: block; font: 700 12px var(--font); letter-spacing: 0; opacity: .75; margin-top: 4px; }
#pausedBadge.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------------- 結局卡 ---------------- */
.overlay.ending { background: radial-gradient(circle at 50% 40%, rgba(255,210,170,.25), rgba(30,15,40,.55)); }
.end-card { width: 560px; background: linear-gradient(180deg, #fffaf0, #fff3e3); border: 3px solid var(--ink); border-radius: 26px; padding: 22px 30px 18px; text-align: center; box-shadow: 0 8px 0 var(--ink), 0 40px 80px rgba(0,0,0,.45); animation: pop .6s cubic-bezier(.2,1.3,.4,1); position: relative; overflow: hidden; }
.end-card::before { content: '✦ ✧ ✦'; position: absolute; top: 10px; left: 0; right: 0; color: #f5b94a; letter-spacing: 8px; font-size: 12px; }
.end-top { font: 800 13px var(--font-b); color: #c77d3a; letter-spacing: 6px; margin-top: 8px; }
.end-card h2 { margin: 4px 0 12px; font: 900 30px var(--font-b); background: linear-gradient(135deg, #e0663a, #9d5bd6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-mgr { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(120,80,40,.1); }
.end-av { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #e9f5ee; flex: none; }
.end-av img { width: 100%; height: 100%; }
.end-say { font-size: 13.5px; line-height: 1.6; font-weight: 700; }
.end-say small { display: block; color: #8a7f95; font-size: 11px; margin-top: 2px; }
.end-mem { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 12px; }
.end-mem div { display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,.7); border-radius: 12px; padding: 7px 10px; animation: lcdin .5s both; }
.end-mem div:nth-child(2) { animation-delay: .15s; } .end-mem div:nth-child(3) { animation-delay: .3s; } .end-mem div:nth-child(4) { animation-delay: .45s; } .end-mem div:nth-child(5) { animation-delay: .6s; } .end-mem div:nth-child(6) { animation-delay: .75s; }
.end-mem span { font-size: 20px; }
.end-mem p { margin: 0; font-size: 13px; line-height: 1.55; font-weight: 700; color: #4a3f55; }
.end-stats { display: flex; justify-content: center; gap: 14px; font-size: 12px; color: #7a6f85; margin-bottom: 14px; }
.end-stats b { color: var(--ink); font: 900 15px var(--font-b); }
.end-note { font-size: 11px; color: #9a8fa5; margin-top: 8px; }

/* ---------------- 光影覆蓋層（GPU 合成） ---------------- */
.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.5s, background 1.5s; }
#fxVig { background: radial-gradient(ellipse 72% 70% at 50% 47%, rgba(40,20,30,0) 55%, rgba(40,20,30,.32) 100%); }
#fxGrain { mix-blend-mode: soft-light; background-size: 256px 256px; }
@keyframes grain { 0% { background-position: 0 0; } 20% { background-position: -83px 41px; } 40% { background-position: 57px -112px; } 60% { background-position: -130px -60px; } 80% { background-position: 101px 88px; } 100% { background-position: 0 0; } }
