/* 3D 場景專用樣式；一般內容與對話框仍由 styles.css 管理。 */
.map-panel { background: #83cdd1; min-height: 740px; }
.map-panel::before { display: none; }
.map-viewport { inset: 0; overflow: hidden; cursor: auto; touch-action: none; }
#world-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -4px; }
#world-canvas { cursor:grab; }
#world-canvas:active { cursor:grabbing; }
#world-canvas:focus-visible { outline: 2px solid #ffffdc; }
#island-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.island-pin { pointer-events: auto; font-size: 11px; padding: 7px 11px; visibility: hidden; }
.island-pin[aria-pressed="true"] { border-color: #c48b4f; background: #fff6dc; }
.player-label { position: absolute; z-index: 4; transform: translate(-50%,-100%); pointer-events: none; white-space: nowrap; background: #245758ee; color: #fffde8; padding: 4px 10px; border: 1px solid #ffffe799; border-radius: 20px; box-shadow: 0 3px 12px #1a4c4f20; font-size: 9px; }
.player-label::after { content: ''; position: absolute; left: calc(50% - 3px); bottom: -4px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #245758; }
.world-heading { position: absolute; z-index: 6; top: 25px; left: 25px; display: flex; align-items: center; gap: 10px; pointer-events: none; color: #245454; }
.world-tag { font: 18px/1 Georgia,serif; border: 1px solid #fff9d5bb; background: #fff8da99; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; }
.world-heading strong { display: block; font-size: 13px; letter-spacing: 1px; }
.world-heading small { display: block; font-size: 9px; color: #427472; margin-top: 2px; }
.world-view-actions { position: absolute; right: 21px; top: 25px; display: flex; gap: 7px; z-index: 6; }
.world-view-actions button { padding: 8px 11px; font-size: 10px; border: 1px solid #ffffdfb3; background: #fffdf1e8; border-radius: 6px; box-shadow: 0 3px 10px #315f5a10; }
.world-view-actions button:hover { background: #fff5cf; }
.world-view-actions button[aria-pressed="true"] { background: #285e5b; color: #fff8de; }
.world-location { position: absolute; z-index: 5; left: 25px; top: 80px; display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 30px; background: #eaf8ecdc; border: 1px solid #fffce1b3; color: #406b61; pointer-events: none; }
.location-dot { width: 5px; height: 5px; border-radius: 50%; background: #64a283; }
.world-location strong { font-size: 9px; font-weight: 600; }
.world-location { max-width:calc(100% - 40px); }
#movement-mode { font-size:8px; white-space:nowrap; color:#967044; }
#travel-status { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.world-location #travel-status { border-left: 1px solid #b0cbba; padding-left: 7px; font-size: 8px; }
.world-instructions { position: absolute; z-index: 5; bottom: 83px; left: 25px; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: calc(100% - 50px); font-size: 9px; color: #e5fbef; text-shadow: 0 1px 3px #246b6c; pointer-events: none; }
.world-instructions kbd { font: inherit; font-size: 8px; padding: 3px 5px; background: #f8f8dcda; color: #467365; border-radius: 3px; text-shadow: none; margin-right: 3px; }
.map-controls { bottom: 29px; left: 24px; }
.map-controls output { min-width: 41px; }
.compass { bottom: 25px; right: 25px; }
.compass svg { transform-origin: center; }
.map-caption { color: #d5f1e8; opacity: .8; }
.movement-pad { display: none; }
#scene-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; background: #e5efdf; color: #3e6961; z-index: 8; padding: 40px; text-align: center; font-size: 13px; line-height: 1.9; }
.loading-island { font-size: 48px; }
@media (min-width: 901px) and (max-width: 1200px) {
  .world-heading { left: 16px; top: 19px; }
  .world-view-actions { right: 14px; top: 72px; }
  .world-view-actions button { font-size: 9px; padding: 6px 8px; }
  .world-location { left: 16px; top: 72px; }
  .world-instructions { left: 17px; max-width: calc(100% - 34px); font-size: 8px; gap: 8px; }
  .map-controls { left: 16px; }
  .compass { right: 15px; }
}
@media (max-width: 900px) {
  .map-panel { min-height: 480px; height: 68svh; max-height: 760px; }
  .world-heading { top: 20px; }
  .world-view-actions { top: 20px; }
  .world-location { top: 70px; }
}
@media (max-width: 580px) {
  .map-panel { height: 65svh; min-height: 510px; max-height: 650px; }
  .world-heading { left: 15px; top: 15px; gap: 7px; }
  .world-heading strong { font-size: 11px; letter-spacing: .3px; }
  .world-heading small { font-size: 8px; }
  .world-tag { width: 29px; height: 31px; font-size: 15px; border-radius: 7px; }
  .world-view-actions { right: 12px; top: 17px; gap: 5px; }
  .world-view-actions button { padding: 6px 7px; font-size: 9px; }
  .world-location { left: 15px; top: 62px; padding: 4px 8px; }
  .island-pin { font-size: 9px; gap: 4px; padding: 5px 7px; }
  .pin-number { font-size: 9px; }
  .pin-status { display: none; }
  .player-label { font-size: 8px; padding: 3px 7px; }
  .world-instructions { bottom: 71px; left: 15px; font-size: 9px; color: #f0fff3; max-width: 200px; }
  .world-instructions > span { display: none; }
  .world-instructions::before { content: '拖曳轉視角 · 點白色道路行走'; }
  .map-controls { left: 13px; bottom: 25px; padding: 3px; }
  .map-controls button { width: 25px; height: 28px; font-size: 18px; }
  .map-controls output { min-width: 34px; font-size: 9px; }
  .map-controls .control-divider { margin: 0 2px; }
  .movement-pad { position: absolute; right: 13px; bottom: 28px; z-index: 6; display: grid; grid-template-columns: repeat(3,44px); grid-template-rows: repeat(2,44px); gap: 3px; }
  .movement-pad button { border: 1px solid #fffbe1; background: #fffdefed; color: #356960; border-radius: 6px; font-size: 17px; touch-action: none; user-select: none; }
  .movement-pad button:active { background: #386e65; color: #fffce9; }
  #move-forward { grid-column: 2; }
  #move-left { grid-column: 1; grid-row: 2; }
  #move-back { grid-column: 2; grid-row: 2; }
  #move-right { grid-column: 3; grid-row: 2; }
  .compass { right: 18px; bottom: 137px; }
  .compass svg { width: 27px; height: 27px; }
  .map-caption { bottom: 5px; font-size: 7px; }
}
@media (max-width: 370px) {
  .map-controls { bottom: 125px; }
  .world-instructions { bottom: 172px; max-width: 180px; }
  .world-heading small { display: none; }
  .world-view-actions button { padding: 6px 4px; }
}
/* Taipei district map */
.auto-tour-control { position:absolute; z-index:6; top:112px; left:25px; display:flex; align-items:center; gap:9px; max-width:calc(100% - 50px); padding:5px; border:1px solid #cfdfce; border-radius:9px; background:#fffdf1ed; box-shadow:0 3px 12px #285d5712; }
.auto-tour-control button { min-height:36px; padding:6px 12px; background:#285d57; color:#fff9e6; border:0; border-radius:6px; font-size:12px; white-space:nowrap; }
.auto-tour-control button[aria-pressed="true"] { background:#c57840; }
.tour-card { position:absolute; z-index:7; left:25px; bottom:114px; width:min(360px,calc(100% - 50px)); padding:18px 20px 12px; border:1px solid #dfd4b9; border-radius:14px; background:#fffdf4f5; box-shadow:0 12px 35px #254b4920; color:#304f48; }
.tour-card[hidden] { display:none; }
.tour-card small { font-size:10px; letter-spacing:2px; color:#ab713e; }
.tour-card h2 { font-size:23px; line-height:1.4; margin:5px 0 8px; }
.tour-card p { font-size:13px; line-height:1.8; margin:0 0 13px; }
.tour-card-footer { display:flex; justify-content:space-between; gap:8px; font-size:10px; color:#637a70; }
.tour-card progress { display:block; width:100%; height:3px; margin-top:10px; border:0; border-radius:3px; accent-color:#ba7c47; }
.tour-card progress::-webkit-progress-bar { background:#e8e2d0; }
.tour-card progress::-webkit-progress-value { background:#ba7c47; }
@media(max-width:580px) { .tour-card { left:15px; bottom:132px; width:calc(100% - 30px); padding:12px 14px 9px; } .tour-card h2 { font-size:18px; margin:2px 0 4px; } .tour-card p { font-size:11px; line-height:1.6; margin-bottom:7px; } .tour-card-footer { font-size:9px; } }
@media(max-width:370px) { .tour-card { bottom:184px; } }
.map-panel:has(.tour-card:not([hidden])) .world-instructions { visibility:hidden; }
#transport-dialog { width:min(660px,calc(100% - 24px)); max-height:88svh; overflow-y:auto; padding:30px; border:1px solid #d4ddcb; border-radius:18px; background:#fffdf3; color:#294f48; }
#transport-dialog h2 { font-size:24px; margin:7px 0 22px; }
#transport-dialog section { border-top:1px solid #e3e4d4; padding:16px 0 5px; }
#transport-dialog h3 { font-size:15px; margin:0 0 12px; }
#transport-dialog p { font-size:12px; line-height:1.7; color:#6c8075; margin:9px 0 13px; }
#transport-dialog label { display:block; font-size:12px; margin:10px 0 5px; }
#transport-dialog select { width:100%; min-height:42px; border:1px solid #bbcbbb; border-radius:7px; background:#fffef7; color:#2e5c50; padding:6px 9px; font:inherit; font-size:13px; }
.transport-modes,.transport-actions,.metro-station-fields { display:flex; gap:8px; }
.metro-station-fields>label { flex:1; min-width:0; }
.transport-modes>button,.transport-actions>button,.transport-secondary { flex:1; min-height:42px; padding:9px; border:1px solid #c6d3bd; border-radius:7px; background:#edf1e4; color:#315a4c; font-size:12px; }
.transport-modes>button[aria-pressed="true"] { background:#285d57; color:#fffbe9; }
.transport-modes small { display:block; margin-top:3px; opacity:.7; }
.transport-secondary { margin-top:8px; width:100%; }
#metro-plan { margin:12px 0; padding:12px; background:#f3ecd7; border-radius:8px; font-size:12px; line-height:1.8; white-space:pre-line; }
#transport-dialog .transport-note { font-size:10px; }
.journey-hud { position:absolute; z-index:7; left:25px; bottom:114px; max-width:calc(100% - 50px); width:350px; padding:15px 18px; background:#fffdf3f5; border:1px solid #c9d6bd; border-radius:12px; color:#28554b; box-shadow:0 8px 25px #264a4920; }
.journey-hud[hidden] { display:none; }.journey-hud small { display:block; font-size:10px; color:#aa7548; letter-spacing:2px; }.journey-hud strong { display:block; margin:6px 0 10px; font-size:15px; }.journey-hud button { min-height:36px; padding:7px 10px; margin-right:6px; color:#fffbe9; background:#285d57; border-radius:6px; }
@media(max-width:580px) { #transport-dialog { padding:25px 17px 16px; }.auto-tour-control { gap:5px; }.auto-tour-control button { padding:6px 8px; font-size:11px; }.journey-hud { left:15px; bottom:132px; max-width:calc(100% - 30px); padding:12px 14px; }.journey-hud strong { font-size:13px; } }
@media(max-width:370px) { .journey-hud { bottom:184px; } }
.auto-tour-control span { color:#4f7165; font-size:10px; padding-right:7px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:580px) { .auto-tour-control { left:15px; top:97px; max-width:calc(100% - 30px); } .auto-tour-control button { min-height:40px; } .auto-tour-control span { max-width:175px; font-size:9px; } }
.landmark-guide { margin-top: 22px; padding: 16px 12px; background: #edf2e7; border: 1px solid #d2dfcc; border-radius: 12px; }
.landmark-guide .section-label { margin-bottom: 12px; }
.landmark-guide .section-label span { font-size: 9px; color: #668173; }
.landmark-guide label { display: block; font-size: 10px; color: #547367; margin: 8px 0 4px; }
.landmark-guide select { width: 100%; min-width: 0; min-height: 38px; padding: 6px; border: 1px solid #c3d4c3; border-radius: 6px; background: #fffdf3; color: #285d57; font: inherit; font-size: 12px; }
.landmark-actions { display: flex; gap: 4px; margin-top: 10px; }
.landmark-actions button { flex: 1; min-height: 40px; padding: 5px 2px; border: 1px solid #b9ccba; border-radius: 6px; color: #285d57; background: #fffdf3; font-size: 10px; }
.landmark-actions button:nth-child(2) { background: #285d57; color: #fff9e8; }
.landmark-actions button:disabled,.landmark-guide select:disabled { opacity: .5; }
.landmark-guide p { font-size: 10px; line-height: 1.7; color: #60776a; margin: 9px 0 0; }
.landmark-label { position: absolute; transform: translate(-50%,0); pointer-events: none; background: #285d57ed; color: #fff9e8; padding: 6px 12px; border: 1px solid #fff5cc; border-radius: 7px; white-space: nowrap; font-size: 12px; box-shadow: 0 3px 15px #285d5722; }
@media(min-width:901px) {
  .map-panel { height: calc(100svh - 88px); min-height: 650px; align-self: start; position: sticky; top: 0; }
  .guide-panel { max-height: calc(100svh - 88px); overflow-y: auto; position: sticky; top: 0; align-self: start; }
}
.map-panel { background: #dfebeb; }
.district-kicker { display: inline-block; margin: 9px 0 8px; padding: 4px 11px; border-radius: 20px; color: #28776e; background: #e4eee5; font-size: 12px; font-weight: 600; }
.district-travel { display: flex; gap: 7px; margin-top: 20px; }
.district-travel button { flex: 1; border: 1px solid #cbdcd0; border-radius: 7px; background: #eef4e8; color: #285d57; font-size: 11px; padding: 10px 6px; }
.district-travel button:first-child { background: #285d57; color: #fff9e6; border-color: #285d57; }
.district-travel button:hover { filter: brightness(1.06); }
.district-travel button:disabled { opacity: .5; cursor: wait; }
.pin-number { font-family: inherit; font-style: normal; font-size: 10px; font-weight: 600; }
.city-overview .island-pin strong { display: none; }
.city-overview .island-pin { padding: 7px 12px; gap: 4px; }
.city-overview .pin-number { font-size: 11px; }
.district-pin { position: absolute; transform: translate(-50%,-50%); white-space: nowrap; background: #ffffffba; border: 1px solid #b9cdb5; border-radius: 5px; padding: 5px 10px; font-size: 10px; color: #597362; pointer-events: auto; z-index: 2; }
.district-pin:hover { background: #ffffff; border-color: #709f7d; }
.map-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
.map-leaders line { stroke: #6b8c7a; stroke-width: 1; opacity: .55; }
.world-instructions { color: #486b62; text-shadow: 0 1px 3px #ffffff; }
.map-caption { color: #4b756b; font-size: 8px; }
.map-source { padding: 12px 24px; font-size: 10px; line-height: 1.8; color: #7f8c7f; background: #f4f5eb; text-align: center; }
.map-source a { color: #47746c; text-underline-offset: 3px; }
@media(max-width:580px) {
  .city-overview .island-pin { padding: 5px 8px; }
  .city-overview .pin-number { font-size: 10px; }
  .district-pin { font-size: 9px; padding: 4px 7px; }
  .world-heading strong { font-size: 10px; }
  .world-heading small { font-size: 7px; }
  .world-instructions { color: #41675f; }
  .map-caption { font-size: 6px; }
  .district-travel button { min-height: 44px; }
  .map-source { font-size: 9px; padding: 12px 18px; }
}

/* Map-first layout: panels disclose content without blocking the map. */
body { height:100svh; overflow:hidden; }
.site-header { height:64px; padding:0 20px; gap:16px; }
.brand strong { font-size:21px; }
.brand-mark { width:34px; height:40px; }
.brand-mark svg { width:32px; height:34px; }
.brand small,.header-note,.world-heading,.detail-footer,.guide-footer,.island-category,.tags,.time-note,.map-caption { display:none; }
.header-actions { gap:14px; }
.header-actions button { min-height:44px; }
.app-layout { display:block; position:relative; height:calc(100svh - 64px); min-height:0; max-width:none; }
.map-panel { position:relative; top:auto; height:100%; min-height:0; max-height:none; border:0; }
.auto-tour-control { top:12px; left:16px; max-width:calc(100% - 32px); gap:4px; padding:4px; }
.auto-tour-control button { min-height:44px; padding:8px 13px; font-size:12px; }
.auto-tour-control #toggle-guide,.auto-tour-control #toggle-detail { color:#285d57; background:transparent; }
.auto-tour-control button[aria-expanded="true"] { background:#e2ebdf !important; box-shadow:inset 0 0 0 1px #86a292; }
#auto-tour-status { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.world-view-actions { top:16px; right:16px; gap:6px; }
.world-view-actions button { min-height:44px; font-size:12px; padding:8px 12px; }
.world-location { left:16px; top:78px; max-width:calc(100% - 32px); padding:5px 10px; }
.world-location strong { font-size:11px; }
.world-location #travel-status,#movement-mode { font-size:10px; }
.camera-modes { position:absolute; z-index:6; left:16px; bottom:78px; display:flex; padding:3px; border:1px solid #d3dfd2; border-radius:9px; background:#fffdf2ed; }
.camera-modes button { min-width:64px; min-height:44px; border-radius:6px; background:transparent; font-size:12px; }
.camera-modes button[aria-pressed="true"] { background:#285d57; color:#fff9e6; }
.map-controls { left:16px; bottom:16px; padding:4px; }
.map-controls button { width:44px; height:44px; }
.map-controls output { min-width:38px; }
.map-controls .control-divider { margin:0 3px; }
.world-instructions { left:164px; bottom:94px; max-width:calc(100% - 190px); font-size:11px; }
.world-instructions > span { display:inline; }
.world-instructions::before { content:none; }
.compass { right:20px; bottom:20px; }
.tour-card,.journey-hud { bottom:146px; left:16px; max-height:calc(100% - 270px); overflow:auto; }
.guide-panel,.detail-panel { position:absolute; z-index:12; top:78px; right:16px; width:min(340px,calc(100% - 32px)); max-height:calc(100% - 94px); overflow-y:auto; overscroll-behavior:contain; padding:16px 20px 20px; border:1px solid #d4ddcc; border-radius:14px; background:#fffdf5fa; box-shadow:0 12px 40px #254b4929; }
.guide-panel { display:block; }
.drawer-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-4px -8px 12px 0; }
.drawer-heading h2,.drawer-heading strong { margin:0; font-size:16px; font-weight:700; }
.drawer-close { width:44px; height:44px; flex-shrink:0; font-size:26px; border-radius:8px; background:#edf1e7; }
.drawer-close:hover { background:#e1e8da; }
.detail-panel .island-symbol { float:none; width:44px; height:44px; margin:14px 0 4px; border-radius:12px; font-size:25px; }
.detail-panel h1 { font-size:26px; }
.detail-panel .detail-rule { margin:18px 0; }
.detail-panel .district-travel { margin-top:14px; }
.district-travel button,.landmark-actions button { min-height:44px; }
.guide-panel .passport { display:grid; grid-template-columns:1fr auto; padding:12px; gap:0 12px; }
.guide-panel .passport-top { grid-column:1; grid-row:1; font-size:11px; }
.guide-panel .progress-heading { grid-column:2; grid-row:1/3; margin:0; }
.guide-panel .progress-heading strong { font-size:28px; }
.guide-panel .progress-heading>span,.passport-dot,.passport-icon { display:none; }
.guide-panel #progress-bar { grid-column:1; grid-row:2; margin:6px 0; }
.guide-panel .progress-summary { grid-column:1/-1; grid-row:3; margin:4px 0 0; justify-content:space-between; font-size:10px; }
.guide-heading { margin:20px 0 10px; }
.guide-heading p,.guide-heading h2>span { display:none; }
.guide-heading h2 { font:600 13px var(--sans); letter-spacing:0; }
.guide-panel .island-nav { display:flex; flex-direction:column; gap:5px; }
.guide-panel .nav-island { display:flex; flex-direction:row; align-items:center; gap:9px; min-height:52px; padding:8px 10px; text-align:left; }
.guide-panel .nav-index { position:static; align-self:center; margin:0; font-size:10px; }
.guide-panel .nav-icon { width:26px; margin:0; font-size:21px; }
.guide-panel .nav-copy { flex:1; }
.guide-panel .nav-copy strong { font-size:12px; letter-spacing:0; }
.guide-panel .nav-copy small { display:block; font-size:10px; }
.guide-panel .nav-state { position:static; align-self:center; }
.landmark-guide { margin-top:18px; }
.landmark-guide select { min-height:44px; font-size:13px; }
.collection-details,.source-details { margin-top:18px; border-top:1px solid #e0e4d7; padding-top:8px; }
.collection-details summary,.source-details summary { min-height:44px; padding:10px 0; cursor:pointer; font-size:12px; }
.guide-panel .badge-section { display:block; margin:8px 0 0; padding:0; }
.guide-panel .badge-section .section-label { display:flex; }
.guide-panel .badge-list { justify-content:space-between; margin-top:12px; }
.guide-panel .badge-section>p,.guide-panel .storage-note { display:block; font-size:10px; text-align:left; margin:12px 0 0; }
.guide-panel .storage-note.error { padding:10px; border:1px solid #d5ab85; border-radius:6px; background:#fff1dc; color:#875032; }
.source-details .map-source { padding:4px 0; background:transparent; text-align:left; }
@media(max-width:760px) {
  .site-header { height:60px; padding:0 12px; gap:8px; }
  .brand { gap:5px; }
  .brand strong { font-size:18px; letter-spacing:.5px; }
  .brand-mark { width:28px; }
  .brand-mark svg { width:27px; }
  .header-actions { gap:8px; }
  .header-actions .plain-button { width:44px; font-size:0; justify-content:center; }
  .header-actions .plain-button span { font-size:21px; }
  .traveler-button { padding:5px 8px; }
  .app-layout { height:calc(100svh - 60px); }
  .auto-tour-control { left:12px; top:10px; width:calc(100% - 24px); max-width:none; gap:3px; }
  .auto-tour-control button { flex:1; min-width:0; padding:7px 6px; font-size:11px; }
  .world-view-actions { top:72px; right:12px; gap:5px; }
  .world-view-actions button { padding:6px 8px; font-size:11px; }
  .world-location { top:124px; left:12px; max-width:calc(100% - 24px); }
  .guide-panel,.detail-panel { top:124px; right:12px; width:min(340px,calc(100% - 24px)); max-height:calc(100% - 136px); padding:12px 18px 18px; }
  .camera-modes { left:12px; bottom:74px; }
  .map-controls { left:12px; bottom:12px; }
  .world-instructions { bottom:132px; left:12px; max-width:186px; font-size:10px; }
  .movement-pad { bottom:74px; right:12px; }
  .compass { display:none; }
  .tour-card,.journey-hud { bottom:176px; left:12px; width:calc(100% - 24px); max-width:360px; max-height:calc(100% - 340px); }
  .tour-card-footer { flex-wrap:wrap; }
}
