/* Village Starter Demo. Separate from the private village: own folder, own storage, own preview. */
:root { --bg: #24152b; --panel: #33203c; --panel2: #3f2a49; --line: #5b4366; --ink: #f6ecf3; --soft: #cdb9d3;
  --accent: #f4b6d2; --accent-ink: #3a1a33; --ok: #9fd8a4; --ask: #f3cf7a; --bad: #f09a9a; }
body.theme-gold { --accent: #f3cf7a; --accent-ink: #3a2a08; }
body.theme-teal { --accent: #8fd6cf; --accent-ink: #0d2f2c; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
h1, h2, h3, #brand { font-family: Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .3rem; } h2 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; } h3 { font-size: 1.05rem; margin: 0 0 .2rem; }
p { margin: .3rem 0 .7rem; } a { color: var(--accent); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; z-index: 9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#demo-flag { margin: 0; padding: 7px 16px; background: var(--ask); color: #2b2005; font-size: .9rem; text-align: center; }
#top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
#brand { color: var(--ink); text-decoration: none; font-size: 1.25rem; margin-right: auto; }
#nav { display: flex; flex-wrap: wrap; gap: 6px; }
button, .btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 14px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary, #nav [aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--ask); outline-offset: 2px; }
main { max-width: 1080px; margin: 0 auto; padding: 22px 20px 70px; outline: none; }
.sub { color: var(--soft); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card img.pic { width: 100%; height: 130px; object-fit: cover; display: block; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .body .btn, .card .body button { margin-top: auto; align-self: flex-start; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 600; background: var(--panel2); color: var(--soft); border: 1px solid var(--line); }
.pill.ask { background: var(--ask); color: #2b2005; border-color: var(--ask); } .pill.ok { background: var(--ok); color: #0f2b12; border-color: var(--ok); }
.pill.sample { background: #fff; color: #7a1030; border-color: #fff; letter-spacing: .03em; }
.hero { display: flex; gap: 18px; align-items: flex-end; margin-bottom: 14px; }
.hero .text { flex: 1; min-width: 0; }
.room-pic { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; margin-bottom: 14px; }
.sprite { flex: none; background-repeat: no-repeat; background-size: 300% 400%; background-position: 50% 0; }
.who { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: .92rem; }
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.door { display: block; text-align: left; border-radius: 14px 14px 6px 6px; border: 2px solid var(--line); background: var(--panel2); padding: 26px 14px 14px; color: var(--ink); text-decoration: none; position: relative; }
.door::after { content: ""; position: absolute; right: 14px; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.door strong { display: block; font-family: Georgia, serif; font-size: 1.05rem; } .door span { color: var(--soft); font-size: .88rem; }
label { display: block; font-weight: 600; margin: .5rem 0 .2rem; }
input[type=text], textarea, select { font: inherit; width: 100%; background: #1c1022; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
textarea { min-height: 120px; resize: vertical; } textarea.brief { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; min-height: 190px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.task { border-top: 1px solid var(--line); padding: 14px 0; } .task:first-of-type { border-top: 0; }
.task .id { font-family: ui-monospace, Menlo, monospace; color: var(--accent); margin-right: 6px; }
.steps { list-style: none; padding: 0; margin: 10px 0 0; counter-reset: s; }
.steps > li { counter-increment: s; border-left: 3px solid var(--line); padding: 2px 0 12px 14px; margin-left: 10px; position: relative; }
.steps > li::before { content: counter(s); position: absolute; left: -13px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: .8rem; text-align: center; line-height: 22px; font-weight: 700; }
.steps > li.done { border-color: var(--ok); } .steps > li.done::before { background: var(--ok); color: #0f2b12; }
.manual { border: 2px dashed var(--ask); border-radius: 12px; padding: 10px 14px; margin-top: 8px; background: #2b2130; }
.proof { border: 2px dashed #fff; border-radius: 10px; padding: 8px 12px; margin-top: 8px; background: #2b1c30; }
.hist { color: var(--soft); font-size: .86rem; margin: 6px 0 0; padding-left: 18px; }
.suggest { border: 2px solid var(--accent); }
table.setup { width: 100%; border-collapse: collapse; } table.setup th, table.setup td { text-align: left; padding: 6px 8px 6px 0; vertical-align: middle; } table.setup th { color: var(--soft); font-size: .85rem; font-weight: 600; }
table.setup td.idcol { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; color: var(--soft); white-space: nowrap; }
#map img { width: 100%; display: block; }
#map .spot { position: absolute; border-radius: 12px; border: 2px solid transparent; background: transparent; padding: 0; }
#map .spot:hover, #map .spot:focus-visible { border-color: var(--accent); background: rgba(244,182,210,.14); }
#map .spot span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
#map .spot.closed span { background: rgba(36,21,43,.82); color: var(--soft); border: 1px dashed var(--soft); font-weight: 400; }
#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; max-width: 90vw; }
#toast:empty { display: none; }
@media (max-width: 640px) { .hero { flex-direction: column; align-items: flex-start; } table.setup td.idcol { display: none; } table.setup th.idcol { display: none; } }
button.open-house { border-radius: 7px; }

/* version 2: several Villages, Team, bulletin, request log */
h4 { font-family: Georgia, serif; font-size: 1rem; margin: 0 0 .4rem; }
.small { font-size: .85rem; } a.plain { color: var(--accent); }
a.id { text-decoration: underline; }
.pill.bad { background: var(--bad); color: #3a0c0c; border-color: var(--bad); }
.switcher { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.switcher .sw-label { margin: 0; font-size: .85rem; color: var(--soft); }
.switcher select { width: auto; max-width: 230px; padding: 6px 8px; border-radius: 8px; border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 12px; }
.tile { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.tile strong { display: block; font-family: Georgia, serif; font-size: 1.7rem; line-height: 1.1; } .tile span { color: var(--soft); font-size: .88rem; }
.tile.ask strong { color: var(--ask); } .tile.bad strong { color: var(--bad); } .tile.ok strong { color: var(--ok); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.panel.warn { border: 2px dashed var(--ask); background: #2b2130; }
.panel.next { border: 2px solid var(--accent); }
.panel.future { border-style: dashed; background: transparent; }
.who-head { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.house-head { font-weight: 700; color: var(--soft); margin: .6rem 0 .2rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
ul.bul { margin: 0; padding-left: 18px; } ul.bul li { margin: 4px 0; }
.tbl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { color: var(--soft); font-size: .8rem; white-space: nowrap; } table.tbl tr:last-child td { border-bottom: 0; }
.org { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; } .org.current { border-color: var(--accent); }
.org-top { display: table; margin: 0 auto 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-radius: 8px; padding: 6px 14px; text-align: center; }
.org-cols { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; border-top: 2px solid var(--line); margin-top: 16px; padding-top: 14px; position: relative; }
.org-cols:empty { display: none; }
.org-cols::before { content: ""; position: absolute; left: 50%; top: -18px; height: 16px; border-left: 2px solid var(--line); }
.org-col { flex: 1 1 220px; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mcard { border-top: 1px solid var(--line); padding: 8px 0; } .mcard:first-of-type { border-top: 0; }
.mtop { display: flex; align-items: center; gap: 10px; } .mtop > div { flex: 1; min-width: 0; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
details summary { cursor: pointer; color: var(--accent); font-size: .88rem; margin-top: 6px; }
pre.folder { background: #1c1022; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; font-size: .85rem; margin: 6px 0 12px; }
.idcol { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; color: var(--soft); }
input[type=date] { font: inherit; background: #1c1022; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; color-scheme: dark; }
@media (max-width: 720px) {
  main { padding: 16px 14px 70px; } h1 { font-size: 1.55rem; }
  #top { padding: 8px 12px; } #brand { width: 100%; margin: 0; }
  #nav .btn { padding: 8px 12px; } .switcher { width: 100%; } .switcher select { flex: 1; max-width: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .hero .sprite { display: none; }
  table.tbl thead { position: absolute; left: -9999px; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr { border-bottom: 2px solid var(--line); padding: 8px 0; } table.tbl tr:last-child { border-bottom: 0; }
  table.tbl td { border: 0; padding: 3px 12px; }
  table.tbl td::before { content: attr(data-label) ": "; color: var(--soft); font-size: .8rem; font-weight: 600; }
  table.setup td, table.setup th { display: block; padding-right: 0; } table.setup tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; } table.setup tr:first-child { display: none; }
  button, .btn { padding: 9px 14px; }
}

/* version 4: Village entrance map, Overview, Town Hall news, request log filters, Team review log, Setup worksheet */
body.view-village main { max-width: 1500px; padding-top: 12px; }
#map { margin: 0 0 8px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0d1410; }
#map .map-scroll { overflow: hidden; }
#map .map-inner { position: relative; animation: arrive 1.6s cubic-bezier(.2,.7,.2,1) both; transform-origin: 50% 46%; }
@keyframes arrive { from { transform: scale(1.5); opacity: 0; filter: blur(3px); } 60% { opacity: 1; filter: none; } to { transform: scale(1); opacity: 1; } }
#map .spot { z-index: 300; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 3px; }
#map .spot span { position: static; transform: none; white-space: normal; text-align: center; max-width: 100%; line-height: 1.15; border-radius: 7px; padding: 2px 7px; font-size: .72rem; }
#map .spot:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.walkers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.walker { position: absolute; left: 0; top: 0; background-repeat: no-repeat; will-change: transform; filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.walker img { width: 100%; height: 100%; display: block; } .walker .bob { width: 100%; height: 100%; }
.walker.flyer .bob { animation: hover 1.6s ease-in-out infinite alternate; } .walker.pet.moving .bob { animation: hop .32s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translateY(-4%); } to { transform: translateY(5%); } } @keyframes hop { from { transform: translateY(0); } to { transform: translateY(-14%); } }
canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }
.walkers { z-index: 150; } #map .map-inner.still { animation: none; } .map-inner.still .bob { animation: none !important; }
.map-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; } .map-foot .map-hint { margin: 4px 0; }
.sprite-img { flex: none; background: center / contain no-repeat; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
button.bank-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; font-size: .82rem; min-height: 104px; } button.bank-item.on { border: 2px solid var(--accent); background: var(--panel2); }
.ws7 .ws-head { background: #cfcfcf; } .ws6 .ws-head { background: #d7b8ea; } .ws5 .ws-head { background: #f3bd7c; } .ws4 .ws-head { background: #f2a9c4; }
.ws-img.wide { aspect-ratio: 2.357; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .walker .bob { animation: none !important; } }
.map-hint { text-align: center; margin: 4px 0 0; }
@media (prefers-reduced-motion: reduce) { #map .map-inner { animation: none; } }
.ext { width: 100%; background-repeat: no-repeat; background-color: #0d1410; }
.top3 { list-style: none; counter-reset: t; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.top3 li { counter-increment: t; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 46px; position: relative; }
.top3 li::before { content: counter(t); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-align: center; line-height: 24px; font-size: .85rem; }
.t3-main { flex: 1 1 320px; min-width: 0; } .t3-main strong { display: block; } .t3-main .sub { font-size: .9rem; }
.t3-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.news { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 12px; padding: 10px 16px 12px; margin-bottom: 6px; }
.news h2 { margin: 0 0 4px; font-size: 1.05rem; } .news ul { margin: 0; padding-left: 18px; } .news li { margin: 3px 0; font-size: .93rem; }
.tbl-wrap.sheet { border-radius: 4px; } .tbl-wrap.sheet table.tbl th { background: #1c1022; color: var(--ink); border-right: 1px solid var(--line); }
.tbl-wrap.sheet table.tbl td { border-right: 1px solid var(--line); } .tbl-wrap.sheet table.tbl tbody tr:nth-child(even) td { background: rgba(255,255,255,.035); }
.room-pic.short { max-height: 230px; }
details.more, details.chq { margin: 0 0 14px; } details.more { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 12px; }
details.more > summary { margin: 0; font-size: .95rem; font-weight: 600; }
details.chq > summary { list-style: none; display: inline-block; border-color: var(--accent); font-weight: 600; margin: 0 0 8px; color: var(--ink); font-size: 1rem; } details.chq > summary::-webkit-details-marker { display: none; }
details.chq[open] > summary { background: var(--accent); color: var(--accent-ink); }
table.tbl th.has-filter { vertical-align: bottom; } select.th-filter { display: block; margin-top: 4px; width: auto; min-width: 86px; max-width: 170px; padding: 3px 6px; border-radius: 6px; font-size: .8rem; font-weight: 400; }
table.tbl tr[hidden] { display: none; }
.row.tight { margin: 0 0 6px; } .row.tight p { margin: 0; } button.small-btn { padding: 3px 10px; font-size: .85rem; }
.review .rev { border-top: 1px solid var(--line); padding: 8px 0; } .review .rev p { margin: .15rem 0; }
dl.wentwell { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; } dl.wentwell dt { font-weight: 700; font-size: .88rem; } dl.wentwell dt.ok { color: var(--ok); } dl.wentwell dt.bad { color: var(--bad); } dl.wentwell dd { margin: 0; }
.ws { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; overflow: hidden; background: var(--panel); }
.ws-head { margin: 0; padding: 7px 14px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; color: #1c1022; }
.ws1 .ws-head { background: #9cc3ea; } .ws2 .ws-head { background: #b9dba0; } .ws3 .ws-head { background: #f0de8a; } .ws4 .ws-head { background: #f3bd7c; } .ws5 .ws-head { background: #d7b8ea; } .ws6 .ws-head { background: #cfcfcf; }
.ws-n { width: 24px; height: 24px; border-radius: 50%; background: #1c1022; color: #fff; font: 700 .85rem/24px -apple-system, sans-serif; text-align: center; flex: none; }
.ws-body { padding: 8px 14px 14px; }
.ws-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px 12px; background: #2b1c30; min-width: 0; } .ws-plabel { margin: 0 0 4px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.ws-preview pre.folder { margin: 0; } .ws-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .ws-two figure { margin: 0; } .ws-two figcaption { font-size: .78rem; color: var(--soft); }
.ws-two .ext, .ws-img { border-radius: 8px; border: 1px solid var(--line); } .ws-img { width: 100%; aspect-ratio: 1.6; object-fit: cover; display: block; }
.ws-char { display: flex; gap: 14px; align-items: center; }
@media (max-width: 720px) {
  body.view-village main { padding: 8px 0 40px; } #map { border-radius: 0; border-left: 0; border-right: 0; }
  #map .map-scroll { overflow-x: auto; overflow-y: hidden; } #map .map-inner { width: 880px; }
  .map-hint { padding: 0 14px; }
  .ws-pair { grid-template-columns: 1fr; }
  table.tbl.x, .filterable table.tbl thead { position: static; display: block; } .filterable table.tbl thead tr { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; border-bottom: 2px solid var(--line); }
  .filterable table.tbl thead th { display: none; border: 0; padding: 0; width: auto; } .filterable table.tbl thead th.has-filter { display: block; }
  select.th-filter { min-height: 40px; font-size: .9rem; max-width: 100%; }
  button.small-btn { padding: 9px 14px; }
}
