/* 各科的島鎮（game/js/town.js） */
/* 網站版整頁會縮放：寬高用建置算好的 --vw、--vh，不能直接寫 vw、vh */
.modal.town { width: min(1100px, calc(var(--vw, 1vw) * 96)); max-height: calc(var(--vh, 1vh) * 94); overflow-y: auto; }
.town h2 { margin: 0 0 2px; text-align: center; }
.town-count { text-align: center; font-weight: 900; margin-bottom: 8px; color: var(--ink); }
.town-land { position: relative; width: min(100%, calc(var(--vh, 1vh) * 66 * 1344 / 768)); margin: 0 auto; aspect-ratio: 1344 / 768; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.town-land .ground { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.town-road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.town-b { position: absolute; aspect-ratio: 1; padding: 0; border: 0; background: none; transform: translate(-50%, -88%); cursor: pointer; }
.town-b img { width: 100%; height: 100%; object-fit: contain; filter: brightness(.2) opacity(.32); }
.town-b.on img { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.town-b.new::after { content: "新！"; position: absolute; top: -6%; right: -8%; padding: 1px 7px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 13px; font-weight: 900; }
.town-b.new img { animation: town-pop .7s ease-out 2; }
@keyframes town-pop { 50% { transform: scale(1.18); } }
.town-info { min-height: 62px; margin: 10px auto 0; max-width: 620px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .7); text-align: center; font-weight: 700; color: var(--ink); }
.town-info b { display: block; font-size: 1.1em; }
.town-info p { margin: 2px 0 0; }
.town-open { position: relative; white-space: nowrap; }
#s-chapters .chap-head .ch-title { flex: 1 0 auto; white-space: nowrap; }
.town-open .dot { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; }
/* 錯題佔領建築（game/js/town.js，家長 2026-11-10）：被佔領的建築變暗、上面跳 ❗；章節頁的島鎮按鈕也掛 ❗、多一顆「去奪回」 */
.town-b.raid img { filter: saturate(.55) brightness(.8) drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.town-b .raid-mark { position: absolute; left: 50%; top: 0; width: clamp(26px, 3.6vw, 44px); aspect-ratio: 1; display: grid; place-items: center; transform: translate(-50%, -80%); border-radius: 50%; background: #e5484d; color: #fff; font: 900 clamp(18px, 2.6vw, 30px)/1 system-ui, sans-serif; font-style: normal; box-shadow: 0 0 0 3px #fff, 0 3px 6px rgba(0, 0, 0, .45); animation: raid-bob 1s ease-in-out infinite; pointer-events: none; }
@keyframes raid-bob { 50% { transform: translate(-50%, -105%); } }
.town-open .raid-mark { position: absolute; top: -10px; right: -8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e5484d; color: #fff; font: 900 17px/1 system-ui, sans-serif; font-style: normal; box-shadow: 0 0 0 2px #fff; animation: raid-bob2 1s ease-in-out infinite; }
@keyframes raid-bob2 { 50% { transform: translateY(-4px); } }
.town-open.raided { box-shadow: inset 0 0 0 2px #e5484d; }
.raid-go { white-space: nowrap; }
.raid-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; color: #5a1a12; }
.raid-box p { max-width: 520px; }
.raid-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(229, 72, 77, .12); color: #5a1a12; font-size: 18px; }
.raid-row.won { background: rgba(60, 160, 90, .15); color: #1d4d2a; }
@media (max-height: 520px), (max-width: 960px) {
  .raid-row { font-size: 24px; }
  .town-open .raid-mark { width: 34px; height: 34px; font-size: 24px; }
}
