/* APP 的大廳與彈出視窗。尺寸都用 em：#stage 的字級跟著畫面寬度縮放，所以整個介面等比例。 */
.hide { display: none !important; }
/* 線上版不顯示測試台專用的東西 */
body.online #btnPanel, body.online #btnRules, body.online #btnHelp, body.online #lnk3d, body.online #rooms,
body.online #panel, body.online #help, body.online #rules { display: none !important; }

#splash { position: absolute; inset: 0; z-index: 50; background: #0b2a4a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2em; }
#splash .logo { font-size: 6em; font-weight: 900; letter-spacing: .15em; color: #fff; text-shadow: 0 .08em 0 #c8432a; }
#splashMsg { font-size: 1.8em; color: #a9c6d8; }

#lobby { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; color: #1d2a33;
  background: linear-gradient(#123a5c, #0b2a4a 40%, #082035); font-size: max(1.5em, 12px); touch-action: pan-y; }
#lbTop { display: flex; align-items: center; gap: .8em; padding: .5em .9em; background: rgba(4,16,26,.55); color: #e8f1f7; }
#lbTop .grow { flex: 1; }
#lbMe { display: flex; align-items: center; gap: .6em; background: none; text-align: left; padding: 0; }
#lbMe .ava { width: 2.4em; height: 2.4em; border-radius: 50%; background: #c8432a; display: flex; align-items: center; justify-content: center; font-size: 1.1em; font-weight: 800; color: #fff; border: .12em solid #f3e6cf; }
#lbMe .nm { font-weight: 700; } #lbMe small { color: #a9c6d8; display: block; font-size: .78em; }
#lbMe .xp { width: 9em; height: .35em; background: rgba(255,255,255,.18); border-radius: 1em; overflow: hidden; margin-top: .2em; }
#lbMe .xp i { display: block; height: 100%; background: #ffd24a; }
#lbCoins { font-weight: 800; color: #ffd24a; font-size: 1.15em; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.3); padding: .25em .8em; border-radius: 1em; }
#lbNav { display: flex; gap: .3em; padding: .45em .9em 0; background: rgba(4,16,26,.35); }
#lbNav button { position: relative; padding: .5em 1.05em; border-radius: .6em .6em 0 0; background: rgba(255,255,255,.08); color: #cfe1ec; font-weight: 600; }
#lbNav button.on { background: #f3e6cf; color: #1d2a33; }
#lbMain { flex: 1; overflow-y: auto; padding: .9em; background: #f3e6cf; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#lbMain *, #modalBox * { touch-action: pan-y; }

.dot { display: none; position: absolute; top: .1em; right: .1em; min-width: 1.25em; height: 1.25em; line-height: 1.25em; border-radius: 1em; background: #d8331f; color: #fff;
  font-size: .68em; font-style: normal; font-weight: 700; text-align: center; padding: 0 .25em; box-sizing: border-box; }
.dot.on { display: block; }
.btn { position: relative; background: #fff; color: #1d2a33; border: .1em solid rgba(29,42,51,.25); border-radius: .5em; padding: .42em .95em; font-weight: 600; white-space: nowrap; }
.btn.pri { background: #c8432a; color: #fff; border-color: #8f2a17; }
.btn.gold { background: #ffd24a; color: #3a2a00; border-color: #b98a00; }
.btn.dis, .btn[disabled] { background: #d9cfbd; color: #8a8273; border-color: transparent; pointer-events: none; }
.btn.sm { padding: .25em .7em; font-size: .88em; }
#lbTop .btn { background: rgba(255,255,255,.12); color: #e8f1f7; border-color: rgba(255,255,255,.25); }

.cols { display: flex; gap: .9em; align-items: flex-start; }
.cols > .main { flex: 1.7; min-width: 0; }
.cols > .side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .7em; }
.card { background: #fffaf0; border: .08em solid #d8c9aa; border-radius: .7em; padding: .7em .9em; box-shadow: 0 .12em 0 rgba(0,0,0,.08); margin-bottom: .7em; }
.side .card { margin-bottom: 0; }
.card h3 { margin: 0 0 .45em; font-size: 1.05em; color: #8f2a17; display: flex; align-items: center; gap: .4em; }
.card h3 small { font-weight: 400; color: #6b6557; font-size: .8em; }
.card p { margin: .2em 0; line-height: 1.5; }
.muted { color: #6b6557; font-size: .88em; }
.rowi { display: flex; align-items: center; gap: .6em; padding: .45em 0; border-top: .06em dashed #d8c9aa; }
.rowi:first-of-type { border-top: 0; }
.rowi .t { flex: 1; min-width: 0; }
.rowi .t b { display: block; }
.rowi .t small { color: #6b6557; }
.bar { height: .5em; background: #e3d6bc; border-radius: 1em; overflow: hidden; margin-top: .25em; }
.bar i { display: block; height: 100%; background: #2f8f5b; }
.tag { display: inline-block; padding: .05em .5em; border-radius: 1em; font-size: .78em; font-weight: 700; background: #1d4d6e; color: #fff; }
.tag.red { background: #c8432a; }
.tag.gold { background: #b98a00; }
.tag.gray { background: #9a917f; }
.grid { display: grid; gap: .7em; }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g7 { grid-template-columns: repeat(7, 1fr); gap: .4em; }
.subnav { display: flex; gap: .4em; margin-bottom: .7em; }
.subnav button { padding: .35em .9em; border-radius: 1em; background: #e3d6bc; color: #4a4336; font-weight: 600; position: relative; }
.subnav button.on { background: #1d4d6e; color: #fff; }

/* 大廳：場次 */
.room { position: relative; border-radius: .8em; padding: .8em .7em; color: #fff; text-align: center; overflow: hidden; background-size: cover; background-position: center; min-height: 9.5em;
  display: flex; flex-direction: column; justify-content: flex-end; border: .12em solid #1d2a33; }
.room::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(4,16,26,.85)); }
.room > * { position: relative; }
.room .x { font-size: 2.4em; font-weight: 900; line-height: 1; text-shadow: 0 .06em 0 #000; }
.room .n { font-weight: 700; }
.room small { color: #cfe1ec; }
.room.lock { filter: grayscale(.9) brightness(.7); }
.room .lk { position: absolute; top: .4em; right: .5em; font-size: .85em; background: rgba(0,0,0,.6); padding: .1em .5em; border-radius: 1em; }

/* 登入月曆、里程碑 */
.day { background: #fffaf0; border: .08em solid #d8c9aa; border-radius: .5em; padding: .35em .2em; text-align: center; font-size: .82em; }
.day b { display: block; color: #8f2a17; }
.day.got { background: #dfe9d8; color: #5d7a5a; }
.day.today { border-color: #c8432a; box-shadow: 0 0 0 .12em #c8432a inset; }
.track { display: flex; gap: .5em; overflow-x: auto; padding-bottom: .3em; touch-action: pan-x pan-y; }
.step { flex: 0 0 9.5em; background: #fffaf0; border: .08em solid #d8c9aa; border-radius: .6em; padding: .5em; text-align: center; font-size: .88em; }
.step b { display: block; color: #1d4d6e; }
.step.got { background: #dfe9d8; }
.step.can { border-color: #c8432a; box-shadow: 0 0 0 .12em #c8432a inset; }
.step .btn { margin-top: .35em; }

/* 圖鑑 */
.fishc { background: #fffaf0; border: .08em solid #d8c9aa; border-radius: .7em; padding: .5em; text-align: center; position: relative; }
.fishc .pic { height: 4.6em; display: flex; align-items: center; justify-content: center; background: #123a5c; border-radius: .5em; margin-bottom: .35em; }
.fishc .pic img { max-width: 88%; max-height: 88%; }
.fishc.no .pic img { filter: brightness(0) opacity(.35); }
.fishc b { display: block; }
.fishc small { color: #6b6557; display: block; }
.tiers { display: flex; gap: .2em; justify-content: center; margin: .3em 0; }
.tiers i { width: 1.5em; height: 1.5em; line-height: 1.5em; border-radius: 50%; font-style: normal; font-size: .72em; font-weight: 700; background: #e3d6bc; color: #8a8273; }
.tiers i.t0.on { background: #2aa5b8; color: #fff; }
.tiers i.t1.on { background: #2f8f5b; color: #fff; }
.tiers i.t2.on { background: #d6a400; color: #fff; }
.tiers i.t3.on { background: linear-gradient(135deg, #e85a9b, #7b5be8, #2aa5b8); color: #fff; }

/* 水族館 */
.tank { position: relative; height: 17em; border-radius: .8em; overflow: hidden; border: .2em solid #1d2a33; background: linear-gradient(#5db9e0, #1c6c9c); }
.tank.bg_wave { background: repeating-radial-gradient(circle at 50% 120%, #2c7fb0 0 1.2em, #4aa3cf 1.2em 2.4em); }
.tank.bg_night { background: radial-gradient(circle at 80% 15%, #f3e6a0 0 1.6em, transparent 1.7em), linear-gradient(#0c1d47, #1d3f78); }
.tank .sand { position: absolute; left: 0; right: 0; bottom: 0; height: 2.2em; background: #efe2c0; }
.tank .sand.s_pebble { background: repeating-linear-gradient(90deg, #9c9a93 0 1.1em, #b8b5ab 1.1em 2.2em); }
.tank .sand.s_coral { background: linear-gradient(#f2b8a6, #e58f7e); }
.tank .dec { position: absolute; bottom: 1.2em; font-size: 4em; line-height: 1; }
.tank .dec.left { left: 5%; }
.tank .dec.center { left: 50%; transform: translateX(-50%); }
.tank .dec.right { right: 5%; }
.tank .fi { position: absolute; width: 18%; animation: swimLR linear infinite; }
.tank .fi img { width: 100%; display: block; }
@keyframes swimLR { 0% { left: 2%; transform: scaleX(1); } 49.9% { left: 80%; transform: scaleX(1); } 50% { left: 80%; transform: scaleX(-1); } 99.9% { left: 2%; transform: scaleX(-1); } 100% { left: 2%; transform: scaleX(1); } }
.tank .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-size: 1.1em; }
.chips { display: flex; flex-wrap: wrap; gap: .4em; }
.chip { padding: .3em .7em; border-radius: 1em; background: #e3d6bc; color: #4a4336; font-size: .9em; font-weight: 600; }
.chip.on { background: #1d4d6e; color: #fff; }
.chip.no { opacity: .45; pointer-events: none; }
.stars { color: #d6a400; letter-spacing: .1em; }

/* 造型、商店 */
.item { position: relative; background: #fffaf0; border: .08em solid #d8c9aa; border-radius: .7em; padding: .6em; text-align: center; }
.item .ic { font-size: 2.6em; line-height: 1.2; height: 1.25em; }
.item b { display: block; }
.item small { color: #6b6557; display: block; min-height: 1.3em; }
.item .btn { margin-top: .35em; }
.item.on { border-color: #c8432a; box-shadow: 0 0 0 .12em #c8432a inset; }
.item.no { opacity: .6; }
.pack .coin { font-size: 1.35em; font-weight: 800; color: #b98a00; }
.pack .x2 { position: absolute; top: .3em; right: .3em; }
.notice { background: #fff3c9; border: .08em solid #d6a400; border-radius: .6em; padding: .5em .8em; margin-bottom: .7em; font-size: .9em; line-height: 1.5; }

/* 排行 */
table.rk { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.rk td, table.rk th { padding: .3em .5em; border-bottom: .06em solid #e3d6bc; text-align: left; }
table.rk td:last-child, table.rk th:last-child { text-align: right; }
table.rk tr.me { background: #ffe9b0; font-weight: 700; }
table.rk th { color: #6b6557; font-weight: 600; font-size: .88em; }

/* 彈出視窗、提示 */
#modal { position: absolute; inset: 0; z-index: 40; background: rgba(4,16,26,.6); display: flex; align-items: center; justify-content: center; font-size: max(1.5em, 12px); color: #1d2a33; }
#modalBox { background: #f3e6cf; border-radius: .9em; padding: 1em 1.2em; width: min(34em, 86%); max-height: 86%; overflow-y: auto; box-shadow: 0 .5em 2em rgba(0,0,0,.5); touch-action: pan-y; }
#modalBox h2 { margin: 0 0 .5em; font-size: 1.2em; color: #8f2a17; }
#modalBox .foot { display: flex; gap: .6em; justify-content: flex-end; margin-top: .9em; flex-wrap: wrap; }
#modalBox input { font: inherit; padding: .4em .6em; border-radius: .4em; border: .1em solid #b9ab8d; width: 14em; background: #fff; color: #1d2a33; -webkit-user-select: text; user-select: text; touch-action: auto; }
#toast { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); z-index: 60; background: rgba(4,16,26,.92); color: #fff; padding: .6em 1.2em; border-radius: .7em; font-size: max(1.5em, 12px); max-width: 80%; text-align: center; border: .08em solid #ffd24a; }
#netBar { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 45; background: rgba(120,20,20,.92); color: #fff; padding: .6em 1.2em; border-radius: .7em; font-size: max(1.6em, 12px); }
#btnBack { order: -1; }
