:root {
  --paper: #F7F3EA; --card: #FDFBF6; --ink: #3A302A; --ink-soft: #6F645A; --line: #4A3F37; --line-faint: #DDD3C4;
  --accent: #B8674A; --sky: #4F7479;
  --font: "Chiron GoRound TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #EAF2EC; color: var(--ink); font-family: var(--font); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; pointer-events: none; }
button, input { font-family: inherit; }
[hidden] { display: none !important; }

#momo-share { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 24px; overflow: auto; color: var(--ink); }
#momo-share::backdrop { background: rgba(41, 34, 36, .65); }
#momo-share .x { position: absolute; right: 8px; top: 8px; z-index: 1; }
.momo-share-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: 24px; align-items: center; }
#momo-share-image { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 12px; background: #F3E4E5; }
.momo-eyebrow { color: #A85E66; font-size: .8rem; letter-spacing: .15em; margin: 0; }
.momo-share-copy h2 { margin: 6px 0 12px; }
.momo-share-copy p { line-height: 1.7; }
.momo-share-actions { display: grid; gap: 10px; margin: 20px 0 12px; }
.momo-share-actions a, .momo-share-actions button, .momo-reopen { display: block; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
#momo-share-download { background: #F3C8D5; }
.momo-share-actions a:hover, .momo-share-actions button:hover, .momo-reopen:hover { background: #F4E1C6; }
.momo-share-tip { font-size: .78rem; color: var(--ink-soft); }
#momo-share-url, #momo-share-caption-text { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line-faint); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: .74rem; }
#momo-share-caption-text { resize: vertical; }
.momo-share-guide { margin: 14px 0; padding: 12px; border: 1px solid var(--line-faint); border-radius: 12px; background: #F7EDE4; font-size: .8rem; line-height: 1.65; }
.momo-share-guide summary { cursor: pointer; font-weight: 700; }
.momo-share-guide ol { padding-left: 1.4em; }
.momo-share-guide p { margin-bottom: 0; }
#momo-share-status { font-size: .82rem; color: var(--sky); min-height: 1.7em; }
.momo-reopen { width: 100%; margin-top: 12px; font-size: .85rem; }
@media (max-width: 600px) {
  #momo-share { padding: 28px 18px 18px; }
  .momo-share-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #momo-share-image { width: min(100%, 170px); margin-inline: auto; }
  .momo-share-copy h2 { font-size: 1.35rem; }
}

.panel {
  background: rgba(253, 251, 246, .92); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 3px 4px 0 rgba(74, 63, 55, .18); backdrop-filter: blur(4px);
}

/* 載入畫面 */
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 20; transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.load-card { width: min(340px, 80vw); text-align: center; }
.load-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.load-bar { height: 14px; border: 2px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); }
.load-bar i { display: block; height: 100%; width: 0; background: #F3C8B0; transition: width .2s; }
.load-text { margin-top: 10px; color: var(--ink-soft); font-size: .95rem; }

/* 左上：站名與目前位置 */
#hud-tl { position: fixed; top: 14px; left: 14px; padding: 10px 14px 10px; z-index: 5; min-width: 170px; }
#hud-tl .back { font-size: .82rem; color: var(--ink-soft); text-decoration: none; }
#hud-tl .back:hover { color: var(--accent); }
.brand { font-weight: 700; font-size: 1.15rem; margin-top: 2px; }
.brand span { font-size: .8rem; background: var(--ink); color: var(--card); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.where { font-size: .9rem; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.where i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-block; }

/* 右上：小地圖、連線狀態、名字 */
#hud-tr { position: fixed; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 5; }
#minimap { width: 160px; height: 160px; border-radius: 50%; border: 2px solid var(--line); background: #CFE0C0; cursor: pointer; box-shadow: 3px 4px 0 rgba(74, 63, 55, .18); }
.net { padding: 4px 12px; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.net .dot { width: 9px; height: 9px; border-radius: 50%; background: #C9B9A6; }
.net .dot.on { background: #5FA36B; box-shadow: 0 0 0 3px rgba(95, 163, 107, .25); }
.net .dot.local { background: #D9A441; }
.nick { padding: 4px 12px; font-size: .85rem; cursor: pointer; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.nick i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); }

/* 進入新地區的大字 */
#banner { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 4;
  opacity: 0; transition: opacity .6s; text-shadow: 0 2px 0 rgba(253, 251, 246, .9), 0 0 18px rgba(253, 251, 246, .9); }
#banner.show { opacity: 1; }
#banner b { display: block; font-size: clamp(1.8rem, 5vw, 2.8rem); }
#banner span { font-size: 1rem; color: var(--ink-soft); letter-spacing: .08em; }

#prompt { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 8px 16px;
  background: var(--ink); color: var(--card); border-radius: 99px; font-size: .95rem; cursor: pointer; white-space: nowrap; }
#prompt kbd { background: var(--card); color: var(--ink); }

/* 房子資訊卡 */
#card { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); width: min(380px, calc(100vw - 32px)); padding: 16px 18px 14px; z-index: 6; }
#card h2 { margin: 4px 0 4px; font-size: 1.35rem; }
#card p { margin: 0 0 10px; color: var(--ink-soft); }
.card-region { font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.card-region i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips span { font-size: .75rem; border: 1.5px solid var(--line); border-radius: 99px; padding: 1px 8px; background: var(--paper); }
.go { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 8px 18px; border-radius: 99px; border: 2px solid var(--line); }
.go:hover { filter: brightness(1.06); }
.card-hint { font-size: .75rem; color: var(--ink-soft); margin-top: 8px; }
.x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-soft); line-height: 1; }

/* 聊天 */
#chat { position: fixed; left: 14px; bottom: 14px; width: min(320px, calc(100vw - 28px)); padding: 6px 8px 8px; z-index: 5; }
#chat-log { list-style: none; margin: 0; padding: 0 2px; max-height: 150px; overflow-y: auto; font-size: .86rem; display: flex; flex-direction: column; gap: 2px; }
#chat-log li { line-height: 1.35; word-break: break-word; }
#chat-log li b { font-weight: 700; }
#chat-log li.sys { color: var(--ink-soft); font-size: .78rem; }
#chat-log:empty { display: none; }
#phrases { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#phrases button { border: 1.5px solid var(--line-faint); background: var(--paper); color: var(--ink); border-radius: 99px; padding: 2px 9px; font-size: .8rem; cursor: pointer; }
#phrases button:hover { border-color: var(--line); background: #FAE8DD; }
#phrases button[data-k="go"] { background: #E3ECEA; }
#chat-login { margin: 6px 2px 0; font-size: .78rem; color: var(--ink-soft); }
#chat-login button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 0 10px; margin-left: 4px; cursor: pointer; font-size: .78rem; color: var(--ink); }
#chat-input { width: 100%; margin-top: 6px; border: 1.5px solid var(--line-faint); border-radius: 10px; padding: 6px 10px; font-size: .9rem; background: var(--card); color: var(--ink); }
#chat-input:focus { outline: 2px solid #F3C8B0; border-color: var(--line); }

/* 右下：表情與說明 */
#actions { position: fixed; right: 14px; bottom: 14px; display: flex; gap: 6px; z-index: 5; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
#emotes { display: flex; gap: 6px; }
#actions button, #emotes button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-size: 1.2rem; cursor: pointer;
  box-shadow: 2px 3px 0 rgba(74, 63, 55, .18); color: var(--ink); }
#actions button:active { transform: translateY(2px); box-shadow: none; }
.touch-only { display: none; }

#help { position: fixed; right: 14px; bottom: 70px; width: min(360px, calc(100vw - 28px)); padding: 14px 18px; z-index: 6; font-size: .9rem; }
#help h3 { margin: 0 0 6px; }
#help ul { margin: 0; padding-left: 1.1em; line-height: 1.8; }
#help .muted { color: var(--ink-soft); font-size: .8rem; margin: 8px 0 0; }
kbd { font-family: inherit; font-size: .75rem; border: 1.5px solid var(--line); border-radius: 5px; padding: 0 5px; margin: 0 1px; background: var(--paper); }

#nick-dlg { padding: 16px 20px; width: min(360px, calc(100vw - 24px)); max-height: 90vh; overflow-y: auto; color: var(--ink); }
#nick-dlg::backdrop { background: rgba(58, 48, 42, .25); }
#nick-dlg h3 { margin: 0 0 10px; }
.nick-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.nick-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 1rem; font-family: inherit; color: var(--ink); background: var(--card); }
#nick-msg.err { color: #A8343A; }
.nick-row button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 12px; cursor: pointer; color: var(--ink); }
#nick-dlg .muted { font-size: .78rem; color: var(--ink-soft); margin: 6px 0 0; }
#acct-slot { display: block; margin-top: 6px; }
#acct-slot .acct-mini { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 1px 10px; font-size: .8rem; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; font-family: inherit; }
#acct-slot:empty { display: none; }
.opt-label { font-size: .8rem; color: var(--ink-soft); margin-top: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.char-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.char-opts .char { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 1.5px solid var(--line-faint); border-radius: 12px; background: var(--card); cursor: pointer; color: var(--ink); font-family: inherit; }
.char-opts .char img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #EEF2F6; }
.char-opts .char b { font-size: .85rem; }
.char-opts .char small { font-size: .68rem; color: var(--ink-soft); text-align: center; line-height: 1.25; }
.char-opts .bean-icon { width: 72px; height: 72px; border-radius: 10px; display: grid; place-items: center; font-size: 2rem; color: var(--ink-soft); background: #EEF2F6; }
.char-opts .char.locked { opacity: .6; cursor: default; }
.char-opts .char.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.hat-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.hat-opts button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 12px; cursor: pointer; color: var(--ink); font-size: .85rem; }
.hat-opts button.on { background: var(--ink); color: var(--card); }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatches button.on { outline: 3px solid var(--ink); outline-offset: 2px; }
#nick-dlg menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; position: sticky; bottom: 0; }
#nick-dlg menu button { border: 2px solid var(--line); border-radius: 99px; padding: 5px 16px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
#nick-dlg menu button.ghost { background: var(--card); color: var(--ink); }

/* 3D 場景裡的標籤（CSS2DRenderer） */
.tag { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(253, 251, 246, .9); border: 1.5px solid var(--line); white-space: nowrap; transform: translateY(-4px); }
.tag.me { background: var(--ink); color: var(--card); }
.tag.sage { background: #F2CE5A; color: #3A302A; }
.tag.sage::before { content: "先賢 · "; font-weight: 600; opacity: .7; }
.bubble { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); max-width: 220px; width: max-content; padding: 5px 10px; font-size: 13px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; white-space: normal; word-break: break-word; text-align: center; font-weight: 400;
  animation: pop .25s ease-out; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; background: #fff; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.emote { position: absolute; bottom: 30px; left: 50%; font-size: 30px; animation: float 1.6s ease-out forwards; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
@keyframes float { from { transform: translate(-50%, 10px) scale(.5); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { transform: translate(-50%, -50px) scale(1); opacity: 0; } }
.dlabel { text-align: center; pointer-events: none; }
.dlabel b { display: block; font-size: 17px; padding: 3px 12px; border-radius: 12px; border: 2px solid var(--line); color: var(--ink); box-shadow: 2px 3px 0 rgba(74, 63, 55, .2); }
.dlabel span { font-size: 11px; color: var(--ink); letter-spacing: .05em; text-shadow: 0 1px 0 #fff; }
.hlabel { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: rgba(253, 251, 246, .92); border: 1.5px solid var(--line); white-space: nowrap; }
.hlabel.near { background: var(--ink); color: var(--card); }

/* 觸控搖桿 */
#stick { display: none; position: fixed; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(74, 63, 55, .5); background: rgba(253, 251, 246, .35); z-index: 7; pointer-events: none; transform: translate(-50%, -50%); }
#stick i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px; border-radius: 50%; background: rgba(253, 251, 246, .9); border: 2px solid var(--line); }

/* ---------- 手機（觸控）版面 ----------
   左上：小地圖與連線狀態；右上：回 2D、目前位置、帳號。
   左下：常駐搖桿（手指按在左半邊任何地方，搖桿就移到那裡）；右下：大跳躍鍵，旁邊表情和聊天。
   房子資訊卡和聊天輸入變成底部的抽屜。 */
@media (pointer: coarse) {
  .touch-only { display: inline-flex; align-items: center; justify-content: center; }
  button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  #hud-tr { left: 12px; right: auto; top: calc(10px + env(safe-area-inset-top)); align-items: flex-start; gap: 6px; }
  #minimap { width: 96px; height: 96px; border-width: 3px; }
  .net { font-size: .72rem; padding: 2px 9px; }
  .nick { font-size: .75rem; padding: 3px 10px; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #hud-tl { left: auto; right: 12px; top: calc(10px + env(safe-area-inset-top)); min-width: 0; padding: 6px 12px; text-align: right; }
  #hud-tl .brand { display: none; }
  #hud-tl .where { justify-content: flex-end; font-size: .85rem; }
  #banner { top: 26%; }
  #banner b { font-size: 1.9rem; }

  #actions { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 58px 88px; grid-template-rows: 58px 88px; gap: 8px; max-width: none; }
  #actions .round { width: 58px; height: 58px; font-size: 1.5rem; }
  #actions #jump-btn { grid-column: 2; grid-row: 2; width: 88px; height: 88px; font-size: 2.2rem; background: #F3C8B0; }
  #emote-btn { grid-column: 1; grid-row: 2; align-self: end; }
  #chat-btn { grid-column: 2; grid-row: 1; justify-self: center; align-self: end; }
  #help-btn { display: none; }
  #emotes { position: absolute; right: 100px; bottom: 74px; display: none; flex-direction: column; gap: 8px; }
  #emotes.open { display: flex; }
  #emotes button { width: 50px; height: 50px; }

  #stick { display: block; left: 92px; top: calc(100% - 104px - env(safe-area-inset-bottom)); opacity: .75; }
  #stick.active { opacity: 1; }

  #chat { left: 12px; bottom: calc(196px + env(safe-area-inset-bottom)); width: min(62vw, 300px); background: rgba(253, 251, 246, .62); box-shadow: none; pointer-events: none; padding: 4px 8px; }
  #chat:not(.typing):has(#chat-log:empty) { display: none; }
  #chat form, #phrases, #chat-login { display: none; }
  #chat-log { max-height: 66px; font-size: .78rem; }
  #chat.typing { pointer-events: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; z-index: 9; background: rgba(253, 251, 246, .97); padding: 10px 12px; box-shadow: 0 -6px 24px rgba(58, 48, 42, .18); }
  #chat.typing #chat-log { max-height: 120px; font-size: .86rem; }
  #chat.typing form:not([hidden]), #chat.typing #chat-login:not([hidden]) { display: block; }
  #chat.typing #phrases { display: flex; }
  #phrases button { padding: 6px 12px; font-size: .9rem; }

  #prompt { bottom: calc(150px + env(safe-area-inset-bottom)); padding: 12px 22px; font-size: 1rem; box-shadow: 0 4px 0 rgba(58, 48, 42, .25); }
  #card { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; width: auto; z-index: 9; }
  #card .go { display: block; text-align: center; padding: 12px; font-size: 1.05rem; }
  #help { bottom: auto; top: 130px; }
}
@media (max-width: 640px) {
  #minimap { width: 104px; height: 104px; }
  #hud-tl { padding: 8px 12px; min-width: 0; }
  .brand { font-size: 1rem; }
}

/* ---------- 玩法（play.js） ---------- */
.play-pill { padding: 4px 12px; font-size: .82rem; cursor: pointer; color: var(--ink); display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: flex-end; max-width: 220px; text-align: right; }
.play-pill small { flex-basis: 100%; font-size: .72rem; color: #9C6A1E; }
.hlabel.lit::before { content: "✦ "; color: #C48A16; }
#card-extra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
#card-extra:empty { display: none; }
.extra-btn { border: 2px solid var(--line); border-radius: 12px; padding: 7px 12px; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-align: left; }
.extra-btn.main { background: #FBE7B8; }
.extra-btn:hover { filter: brightness(1.04); }
.extra-btn:disabled { opacity: .6; cursor: default; }
.extra-note { margin: 0 !important; font-size: .85rem; color: #9C6A1E !important; }

#quiz { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: min(78vh, 720px); overflow-y: auto; padding: 18px 20px 16px; z-index: 8; }
.quiz-head { font-weight: 700; font-size: 1.05rem; padding-right: 24px; }
.quiz-head em { font-style: normal; color: #C48A16; margin-left: 8px; font-size: .85rem; }
.quiz-src { font-size: .75rem; color: var(--ink-soft); margin-top: 2px; }
.quiz-q { margin: 12px 0; line-height: 1.7; font-size: 1.02rem; }
.quiz-opts { display: grid; gap: 6px; }
.quiz-opts button { display: flex; gap: 10px; align-items: baseline; text-align: left; border: 1.5px solid var(--line-faint); background: var(--card); border-radius: 10px; padding: 7px 10px; cursor: pointer; color: var(--ink); font-size: .95rem; }
.quiz-opts button b { flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8rem; }
.quiz-opts button.on { border-color: var(--ink); background: #FBE7B8; }
.quiz-tip { font-size: .78rem; color: var(--ink-soft); margin: 6px 0 0; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.quiz-actions button, .quiz-self button, #invite button, #photo-bar button, .pass-actions button {
  border: 2px solid var(--line); border-radius: 99px; padding: 5px 14px; background: var(--card); color: var(--ink); cursor: pointer; font-weight: 700; font-size: .88rem; }
.quiz-actions .main, .quiz-self .main, #invite .main, #photo-bar .main { background: var(--accent); color: #fff; }
.quiz-out { margin-top: 12px; line-height: 1.7; }
.quiz-out:empty { display: none; }
.quiz-out .good { color: #3F7A4F; }
.quiz-way { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--paper); font-size: .92rem; }
.quiz-way b { display: block; font-size: .8rem; color: var(--ink-soft); }
.quiz-self { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.quiz-wait { color: var(--ink-soft); }

#passport { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); width: min(400px, calc(100vw - 24px)); max-height: 82vh; overflow-y: auto; padding: 16px 18px; z-index: 8; }
#passport h3 { margin: 0 0 4px; }
#passport h4 { margin: 14px 0 6px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
#passport h4 small { font-weight: 400; font-size: .78rem; color: var(--ink-soft); }
.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; font-size: .72rem; line-height: 1.2; padding: 6px;
  border: 2px dashed var(--line-faint); color: var(--ink-soft); }
.stamp.got { border: 2.5px solid var(--d); background: var(--c); color: var(--ink); font-weight: 700; transform: rotate(-8deg); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .76rem; border: 1.5px dashed var(--line-faint); border-radius: 99px; padding: 2px 9px; color: var(--ink-soft); }
.badge.got { border: 1.5px solid #9C6A1E; background: #FBE7B8; color: var(--ink); }
.pass-line { font-size: .85rem; margin: 10px 0 0; }
.pass-actions { margin-top: 12px; }
.pass-note { font-size: .72rem; color: var(--ink-soft); margin: 10px 0 0; }

#invite { position: fixed; left: 50%; top: 16%; transform: translateX(-50%); padding: 12px 16px; z-index: 9; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
#invite div { display: flex; gap: 8px; }

/* 拍照模式：只留下畫面和底下一排按鈕 */
body.photo #hud-tl, body.photo #hud-tr, body.photo #chat, body.photo #actions, body.photo #prompt, body.photo #card,
body.photo #help, body.photo #quiz, body.photo #passport, body.photo #invite, body.photo #stick { display: none !important; }
body.photo-nonames #labels { visibility: hidden; }
#photo-bar { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 10px; z-index: 9; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: calc(100vw - 20px); }
#photo-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 10; }
#photo-flash.go { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
@media (pointer: coarse) {
  #photo-btn { display: none; }
  .play-pill { font-size: .72rem; padding: 2px 9px; max-width: 150px; }
  #passport { right: 8px; left: 8px; width: auto; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; max-height: 70vh; }
  #quiz { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-height: 72vh; }
}
