/* 藝術家村（山谷）首頁的介面：畫面留給風景，文字只放四個角落。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1b1a1c; font-family: "Noto Serif TC", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", serif; color: #f4efe6; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.glass { background: rgba(20, 20, 22, 0.46); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 12px; }
.pill { font: inherit; font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 15px; letter-spacing: 0.08em; color: #1f1a14; background: #f0d7a8; border: 0; border-radius: 999px; padding: 12px 22px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); text-decoration: none; cursor: pointer; white-space: nowrap; }

#top { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; z-index: 3; }
#title { padding: 9px 14px 10px; min-width: 0; }
#title h1 { font-size: 17px; font-weight: 500; letter-spacing: 0.32em; margin-right: -0.32em; }
#where { font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 12px; color: #e3d6bf; margin-top: 4px; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
#links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; pointer-events: auto; font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; max-width: 62vw; }
#links a, #links button, #more summary { color: #f4efe6; text-decoration: none; font: inherit; font-size: 12.5px; letter-spacing: 0.06em; padding: 7px 11px; white-space: nowrap; cursor: pointer; list-style: none; display: block; }
#more summary::-webkit-details-marker { display: none; }
#more { position: relative; }
#more[open] > a { position: absolute; right: 0; top: calc(100% + 6px); }
#more[open] > a + a { top: calc(200% + 12px); }
#sound[aria-pressed="true"] { background: rgba(240, 215, 168, 0.9); color: #1f1a14; border-color: transparent; }

#help { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); right: max(14px, env(safe-area-inset-right)); font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 11.5px; color: #e9e1d2; padding: 6px 11px; max-width: calc(100% - 28px); pointer-events: none; opacity: 0.86; transition: opacity 0.6s ease; z-index: 2; }
#help span { white-space: nowrap; }
#help span + span::before { content: " · "; opacity: 0.6; }
#help.dim { opacity: 0; }

#enter { position: fixed; left: 50%; bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; max-width: calc(100% - 28px); z-index: 4; }
#enter.on { opacity: 1; transform: translateX(-50%); pointer-events: auto; }

/* 名牌＋字幕：畫面下方置中，像美術館的語音導覽字幕 */
#talk { position: fixed; left: 50%; bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); transform: translateX(-50%); width: min(620px, calc(100% - 28px)); text-align: center; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 0.35s ease; }
#talk.on { opacity: 1; }
#talk[hidden] { display: block; visibility: hidden; }
#talk-name { display: inline-block; font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 12px; letter-spacing: 0.2em; color: #1f1a14; background: rgba(240, 215, 168, 0.94); border-radius: 999px; padding: 4px 13px 4px 15px; margin-bottom: 8px; }
#talk-text { font-size: 16px; line-height: 1.75; letter-spacing: 0.06em; color: #fbf6ec; background: rgba(18, 17, 18, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 14px; padding: 12px 18px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
#talk-action { display: inline-block; margin-top: 10px; pointer-events: auto; font-size: 14px; padding: 10px 20px; }
#talk-action[hidden] { display: none; }

/* 搖桿：GTA7 的固定搖桿（左下），只有觸控裝置顯示 */
#joy { position: fixed; left: max(22px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); width: 112px; height: 112px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.42); background: rgba(0, 0, 0, 0.2); display: none; touch-action: none; z-index: 4; }
body.touch #joy { display: block; }
#joy.on { background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.7); }
#knob { position: absolute; left: 32px; top: 32px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.72); pointer-events: none; }

/* 女主人名冊 */
#roster { position: fixed; inset: max(64px, calc(env(safe-area-inset-top) + 58px)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) auto; width: min(430px, calc(100% - 28px)); background: rgba(20, 19, 20, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; z-index: 6; display: flex; flex-direction: column; overflow: hidden; font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
#roster[hidden], #roster-btn[hidden] { display: none; }
#roster header { padding: 14px 44px 10px 16px; position: relative; flex: none; }
#roster h2 { font-family: "Noto Serif TC", "PingFang TC", serif; font-size: 16px; font-weight: 500; letter-spacing: 0.24em; }
#roster p { font-size: 11.5px; color: #cfc4b0; margin-top: 5px; line-height: 1.6; }
#roster-close { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; background: none; border: 0; color: #e9dcc4; font-size: 22px; cursor: pointer; }
#roster-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: max-content; align-content: start; gap: 8px; padding: 4px 12px 14px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rcard { position: relative; display: block; padding: 0 0 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; overflow: hidden; color: #f4efe6; font: inherit; text-align: center; cursor: pointer; }
.rcard img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #2a2826; }
.rcard b { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.12em; margin-top: 6px; }
.rcard span { display: block; font-size: 10px; color: #cfc4b0; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.rcard i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.rcard:disabled { opacity: 0.5; cursor: default; }
.rcard:not(:disabled):hover { border-color: rgba(240, 215, 168, 0.7); }
@media (max-width: 560px) { #roster-grid { grid-template-columns: repeat(3, 1fr); } #roster { inset: max(98px, calc(env(safe-area-inset-top) + 92px)) 14px max(150px, calc(env(safe-area-inset-bottom) + 140px)) 14px; width: auto; } }

#fade { position: fixed; inset: 0; background: #0d0d0d; opacity: 0; pointer-events: none; transition: opacity 0.45s ease; z-index: 9; }
#fade.on { opacity: 1; }
#loader { position: fixed; inset: 0; background: #1b1a1c; display: grid; place-items: center; color: #e9dcc4; transition: opacity 0.9s ease; z-index: 10; }
#loader.done { opacity: 0; pointer-events: none; }
.lw { text-align: center; }
.lt { font-size: 26px; letter-spacing: 0.5em; margin-right: -0.5em; font-weight: 400; }
.ls { font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 12px; letter-spacing: 0.24em; margin-top: 14px; opacity: 0.7; }
.lb { width: 160px; height: 1px; background: rgba(255, 255, 255, 0.18); margin: 18px auto 0; }
.lb i { display: block; height: 100%; width: 8%; background: #f0d7a8; transition: width 0.4s ease; }

body.touch #help { left: 148px; right: 14px; text-align: right; font-size: 11px; }
@media (max-width: 560px) {
  #title h1 { font-size: 15px; }
  #links a, #links button, #more summary { font-size: 11.5px; padding: 6px 9px; }
  #links { max-width: 56vw; }
  #talk { bottom: max(158px, calc(env(safe-area-inset-bottom) + 150px)); }
  #talk-text { font-size: 14.5px; line-height: 1.7; padding: 10px 14px; }
  #enter { font-size: 14px; padding: 11px 18px; bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); }
  #enter.on ~ #talk, body.prompting #talk { bottom: max(206px, calc(env(safe-area-inset-bottom) + 196px)); }
}
@media (orientation: landscape) and (max-height: 480px) {
  #talk { bottom: 64px; width: min(560px, calc(100% - 320px)); }
  #talk-text { font-size: 13.5px; line-height: 1.6; padding: 8px 14px; }
  #enter { bottom: 14px; }
  #help { display: none; }
}
