/* ===== 第 6 輪：設定、任務與引導、拍照、安全、邀請、提示 ===== */
:root { --ok:#3ecf6a; --warn:#e0903a; --bad:#e8443a; }

/* ---- 上方按鈕列：新增 拍照／邀請／設定。窄螢幕只留圖示 */
#topbar { flex-wrap:wrap; justify-content:flex-end; max-width:calc(50vw - 190px); min-width:300px; }
#topbar button .ic { font-size:15px; line-height:1; }
#topbar button .lb { margin-left:5px; }
#btnQuests { position:absolute; left:12px; top:calc(10px + 160px + 34px + env(safe-area-inset-top)); display:flex; align-items:center; gap:4px; font-weight:800; padding:6px 13px; border-color:var(--acc); }
#btnQuests .ic { color:#ffb02e; font-size:15px; }
#btnQuests i { position:absolute; right:-6px; top:-8px; min-width:20px; height:20px; border-radius:10px; background:var(--bad); color:#fff; font-style:normal; font-size:12px; line-height:20px; text-align:center; box-shadow:0 2px 6px var(--shadow); }
#btnQuests.guide { animation:r6pulse 1.4s infinite; }
@keyframes r6pulse { 0%,100% { box-shadow:0 2px 8px var(--shadow), 0 0 0 0 rgba(255,176,46,.6); } 50% { box-shadow:0 2px 8px var(--shadow), 0 0 0 9px rgba(255,176,46,0); } }
@media (max-width:1100px) { #topbar button .lb { display:none; } #topbar button { padding:7px 11px; } }
@media (max-width:900px) { .wide-only { display:none; } #topbar { max-width:calc(100vw - 150px); min-width:0; } }
@media (max-width:700px) {
  #topbar { max-width:calc(100vw - 144px); }
  #btnQuests { top:calc(10px + 90px + 30px + env(safe-area-inset-top)); padding:5px 11px; font-size:13px; }
  #btnQuests .lb { display:inline; }
  /* 頂列的按鈕變 7 個會折成兩行：等級／金幣列往下讓出第二行 */
  #prog { top:calc(10px + 88px + env(safe-area-inset-top)); }
  #statcard { top:calc(10px + 134px + env(safe-area-inset-top)); }
}

/* ---- 共用小視窗 */
#r6 { position:fixed; inset:0; z-index:14; display:flex; align-items:center; justify-content:center; background:rgba(40,30,60,.38); padding:12px; touch-action:pan-y; }
.r6-card { position:relative; width:min(460px, 100%); max-height:min(88vh, 720px); overflow-y:auto; background:var(--card); color:var(--tx); border:1px solid var(--line); border-top:5px solid var(--acc); border-radius:22px; padding:18px 20px 16px; box-shadow:0 14px 44px var(--shadow); user-select:none; animation:r6in .22s cubic-bezier(.34,1.4,.64,1); }
@keyframes r6in { from { transform:translateY(14px) scale(.96); opacity:0; } to { transform:none; opacity:1; } }
.r6-card h2 { margin:0 28px 10px 0; font-size:21px; color:var(--title); }
.r6-card h3 { margin:14px 0 6px; font-size:15px; display:flex; align-items:baseline; gap:8px; }
.r6-card h3 em { font-style:normal; font-size:12px; font-weight:600; opacity:.7; }
.r6-x { position:absolute; right:12px; top:12px; width:34px; height:34px; padding:0; border-radius:50%; font-size:15px; line-height:1; }
.r6-note { font-size:14px; line-height:1.65; margin:6px 0 10px; }
.r6-row { padding:9px 0; border-bottom:1px dashed var(--line); }
.r6-row > b { display:block; font-size:14px; margin-bottom:6px; }
.r6-row small { display:block; opacity:.72; font-size:12px; margin-top:5px; line-height:1.5; }
.r6-seg { display:flex; gap:6px; } .r6-seg.wrap { flex-wrap:wrap; }
.r6-seg button { flex:1; padding:8px 10px; border-radius:12px; font-weight:700; font-size:14px; background:#fff; color:#4a3a5c; }
body.night .r6-seg button { background:rgba(255,255,255,.1); color:var(--tx); }
.r6-seg button.on { background:var(--acc); color:var(--acc-tx); border-color:var(--acc); }
.r6-slider { display:flex; align-items:center; gap:10px; } .r6-slider input { flex:1; accent-color:#ff8a3d; height:28px; } .r6-slider em { width:44px; text-align:right; font-style:normal; font-weight:800; font-size:13px; }
.r6-chip { display:inline-flex; align-items:center; gap:6px; background:#eee3ff; color:#4a3a5c; border-radius:999px; padding:3px 4px 3px 12px; margin:0 6px 6px 0; font-size:13px; font-weight:700; }
.r6-chip button { padding:2px 10px; font-size:12px; border-radius:999px; }
.r6-actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:14px; }
.r6-actions button { padding:9px 18px; border-radius:14px; font-weight:700; }
.r6-actions button.primary, .q-btns button.primary { background:var(--acc); color:var(--acc-tx); border-color:var(--acc); font-weight:800; }
.r6-actions button:disabled, .q-btns button:disabled { opacity:.45; cursor:not-allowed; }
.r6-link { width:100%; font:inherit; font-size:13px; padding:10px 12px; border-radius:12px; border:2px solid var(--line); background:#fff; color:#4a3a5c; user-select:text; -webkit-user-select:text; }

/* ---- 檢舉 */
.r6-reasons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.r6-reasons button { border-radius:14px; padding:11px 8px; font-weight:700; font-size:14px; background:#fff; color:#4a3a5c; }
.r6-reasons button.on { background:var(--acc); color:var(--acc-tx); border-color:var(--acc); box-shadow:0 0 0 2px var(--acc) inset; }
.pc-safe { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; margin:2px 0 8px; }
.pc-safe button { border-radius:12px; padding:7px 4px; font-size:13px; font-weight:700; opacity:.9; }
.pc-safe button.warn { color:var(--bad); border-color:rgba(232,68,58,.45); }
.pc-head em.afk { background:#dfeaff; color:#4a6fb0; }

/* ---- 任務面板 */
.r6-quests .q-sec { border-top:1px dashed var(--line); padding-top:4px; margin-top:8px; } .r6-quests .q-sec:first-of-type { border-top:0; margin-top:0; }
.q-guest { background:#fff3d8; color:#6b4a10; border-radius:12px; padding:8px 12px; font-size:13px; line-height:1.55; margin:0 0 6px; }
.q-onb { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.q-onb li { display:flex; align-items:center; gap:10px; background:rgba(255,255,255,.55); border:1px solid var(--line); border-radius:14px; padding:7px 10px; }
body.night .q-onb li { background:rgba(255,255,255,.07); }
.q-onb li > i { flex:none; width:26px; height:26px; border-radius:50%; background:#ffd23a; color:#5a3b00; font-style:normal; font-weight:900; display:flex; align-items:center; justify-content:center; font-size:13px; }
.q-onb li.ok > i { background:var(--ok); color:#fff; } .q-onb li.ok { opacity:.72; }
.q-onb li > span { flex:1; } .q-onb li b { display:block; font-size:14px; } .q-onb li small { display:block; font-size:12px; opacity:.72; line-height:1.4; }
.q-onb li em, .q-list li em { font-style:normal; font-weight:800; font-size:13px; white-space:nowrap; } .q-list li em.got { color:var(--ok); }
.q-note { font-size:13px; margin:8px 0 4px; line-height:1.6; } .q-note.ok { color:var(--ok); font-weight:700; }
.q-btns { display:flex; gap:8px; margin:8px 0 2px; flex-wrap:wrap; } .q-btns button { border-radius:14px; padding:9px 16px; font-weight:700; }
.q-foot { display:block; opacity:.65; font-size:12px; margin-top:6px; }
.q-login { display:grid; grid-template-columns:repeat(7, 1fr); gap:5px; margin:6px 0 4px; }
.q-day { position:relative; text-align:center; background:rgba(255,255,255,.6); border:2px solid var(--line); border-radius:12px; padding:5px 0 6px; font-size:12px; }
body.night .q-day { background:rgba(255,255,255,.08); }
.q-day small { display:block; opacity:.7; font-size:11px; } .q-day b { display:flex; flex-direction:column; align-items:center; gap:1px; font-size:13px; } .q-day b .coin { width:15px; height:15px; }
.q-day.today { border-color:var(--acc); box-shadow:0 0 0 2px var(--acc) inset; background:#fff3d8; color:#4a3a5c; }
.q-day.big { background:linear-gradient(#fff3d8,#ffe0a0); color:#4a3a5c; } .q-day.got { opacity:.55; }
.q-day .chk { position:absolute; right:2px; top:1px; color:var(--ok); font-weight:900; font-size:13px; }
.q-list { list-style:none; margin:0; padding:0; display:grid; gap:7px; }
.q-list li { display:flex; align-items:center; gap:10px; background:rgba(255,255,255,.55); border:1px solid var(--line); border-radius:14px; padding:8px 12px; } body.night .q-list li { background:rgba(255,255,255,.07); }
.q-list li > span { flex:1; } .q-list li b { font-size:14px; } .q-list li small { font-size:12px; opacity:.7; }
.q-list li.done { border-color:var(--acc); background:#fff3d8; color:#4a3a5c; } .q-list li.claimed { opacity:.55; }
.q-list li button { border-radius:12px; padding:6px 12px; font-weight:800; }
.q-bar { height:8px; border-radius:4px; background:rgba(74,58,92,.16); overflow:hidden; margin:4px 0 2px; } .q-bar i { display:block; height:100%; background:linear-gradient(90deg,#7fd9b0,#4fc7a4); border-radius:4px; }
.bw-dot { display:inline-block; min-width:18px; height:18px; line-height:18px; margin-left:5px; border-radius:9px; background:var(--bad); color:#fff; font-style:normal; font-size:11px; text-align:center; }
.bw-body .q-sec h3 { font-size:15px; }

/* ---- 新手引導 */
#guide { position:fixed; left:0; top:0; z-index:7; pointer-events:none; will-change:transform; }
.gd-bub { position:absolute; left:50%; bottom:52px; transform:translateX(-50%); pointer-events:auto; background:var(--card); color:var(--tx); border:2px solid var(--acc); border-radius:18px; padding:9px 12px 8px; box-shadow:0 8px 26px var(--shadow); touch-action:manipulation; }
.gd-top { display:flex; align-items:center; gap:8px; } .gd-top b { flex:1; font-size:13px; color:var(--title); } .gd-top em { font-style:normal; font-weight:900; font-size:12px; background:#fff3d8; color:#8a5b00; border-radius:999px; padding:1px 8px; }
.gd-bub p { margin:4px 0 6px; font-size:14px; line-height:1.5; font-weight:600; }
.gd-btns { display:flex; gap:6px; justify-content:flex-end; } .gd-btns button { padding:3px 10px; font-size:12px; border-radius:999px; opacity:.85; }
.gd-arrow { position:absolute; left:var(--ax,0px); top:-30px; width:0; height:0; margin-left:-14px; border-left:14px solid transparent; border-right:14px solid transparent; border-bottom:26px solid var(--acc); filter:drop-shadow(0 3px 2px rgba(60,30,0,.4)); rotate:var(--rot,180deg); animation:gdbounce .75s ease-in-out infinite alternate; }
#guide.edge .gd-arrow { top:-26px; }
@keyframes gdbounce { from { translate:0 -4px; } to { translate:0 7px; } }

/* ---- 提示列、掛機提示、被請出去 */
#netbanner { position:fixed; left:50%; top:calc(58px + env(safe-area-inset-top)); transform:translateX(-50%); z-index:13; padding:7px 18px; border-radius:999px; font-weight:700; font-size:14px; background:var(--panel); border:2px solid var(--warn); box-shadow:0 4px 16px var(--shadow); max-width:92vw; text-align:center; pointer-events:none; }
#netbanner.ok { border-color:var(--ok); } #netbanner.warn::before { content:''; display:inline-block; width:12px; height:12px; margin-right:8px; border-radius:50%; border:2px solid var(--warn); border-top-color:transparent; vertical-align:-1px; animation:r6spin .8s linear infinite; }
@keyframes r6spin { to { transform:rotate(360deg); } }
#afkchip { position:fixed; left:50%; bottom:calc(96px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:6; padding:6px 16px; border-radius:999px; background:#dfeaff; color:#33507e; font-weight:700; font-size:13px; box-shadow:0 3px 12px var(--shadow); pointer-events:none; }
.rtag .zz { font-style:normal; font-size:10px; font-weight:900; color:#4a6fb0; margin-left:5px; animation:r6zz 1.6s ease-in-out infinite; }
@keyframes r6zz { 50% { opacity:.35; transform:translateY(-2px); } }
.r6-kick .r6-note { font-size:15px; }

/* ---- 拍照模式：隱藏所有介面，只留 3D */
body.photo #hud, body.photo #labels, body.photo #rlayer, body.photo #prompt, body.photo #guide, body.photo #netbanner, body.photo #afkchip, body.photo #btnQuests { display:none !important; }
body.photo #nameplate .nm, body.photo #nameplate .ti { display:none; }
#photobar { position:fixed; left:50%; bottom:calc(12px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:12; width:min(560px, calc(100vw - 20px)); background:var(--panel); border:1px solid var(--line); border-radius:22px; padding:10px 12px 12px; box-shadow:0 8px 30px var(--shadow); backdrop-filter:blur(8px); touch-action:pan-y; }
.ph-tabs { display:flex; align-items:center; gap:6px; margin-bottom:8px; } .ph-tabs button { padding:5px 14px; font-weight:700; font-size:13px; } .ph-tabs button.on { background:var(--acc); color:var(--acc-tx); border-color:var(--acc); }
.ph-hint { flex:1; text-align:right; font-size:11px; opacity:.65; }
.ph-row { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; } .ph-row button { padding:6px 12px; font-size:13px; font-weight:700; border-radius:999px; background:#fff; color:#4a3a5c; }
.ph-row.sm button { padding:4px 10px; font-size:12px; } .ph-row button.on { background:var(--acc); color:var(--acc-tx); border-color:var(--acc); }
.ph-row[class*="sm"] button[data-sign] { background:var(--c); color:#fff; border-color:transparent; text-shadow:0 1px 2px rgba(0,0,0,.3); } .ph-row button[data-sign].on { outline:3px solid #3a2f4a; }
.ph-row.em button { padding:3px; line-height:0; } .ph-row.em canvas { width:28px; height:28px; image-rendering:pixelated; } .ph-row.em button.glyph { line-height:1; font-size:20px; padding:3px 8px; }
.ph-act { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.shutter { width:64px; height:64px; border-radius:50%; padding:0; border:4px solid #fff; background:var(--acc); box-shadow:0 0 0 3px var(--acc), 0 4px 12px var(--shadow); display:flex; align-items:center; justify-content:center; margin:0 auto; }
.shutter i { width:34px; height:34px; border-radius:50%; background:#fff; opacity:.9; } .shutter:active { transform:scale(.94); }
.ph-act button[data-done] { position:absolute; right:16px; bottom:22px; padding:8px 16px; }
#photoexit { position:fixed; left:calc(12px + env(safe-area-inset-left)); top:calc(12px + env(safe-area-inset-top)); z-index:12; font-weight:700; }
#photoflash { position:fixed; inset:0; z-index:13; background:#fff; pointer-events:none; opacity:0; } #photoflash.go { animation:r6flash .45s ease-out; }
@keyframes r6flash { 0% { opacity:.9; } 100% { opacity:0; } }
#photothumb { position:fixed; left:calc(14px + env(safe-area-inset-left)); bottom:calc(14px + env(safe-area-inset-bottom)); z-index:12; width:96px; height:64px; border-radius:12px; border:3px solid #fff; background-size:cover; background-position:center; box-shadow:0 4px 14px var(--shadow); }

/* ---- 接待員 */
.rtag.npc .ti { display:inline-block; }
/* ---- 觸控小螢幕 */
@media (max-width:700px) {
  .r6-card { padding:16px 14px 14px; border-radius:20px; } .q-login { gap:3px; } .q-day { font-size:11px; padding:4px 0 5px; }
  .gd-bub { bottom:46px; } #photobar { padding:8px 10px 10px; } .ph-act button[data-done] { bottom:16px; }
}
