/* Player towns (towns.html, assets/towns.js): the island of players' places, its pills and
   buttons, the card for a place or a cat, and the list of players under it. */
/* The island fills the screen under the header, like the Live Map; the list of players is under it. */
.tw-h1{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
.tw-live{padding:0;}
.tw-stage{position:relative; height:calc(100svh - 69px - env(safe-area-inset-top,0px)); min-height:460px; overflow:hidden; background:#B3D4E0; --side:0px; --gap:14px;}
.tw-canvas{display:block; width:100%; height:100%; touch-action:none; cursor:grab;}
.tw-canvas:active{cursor:grabbing;}

.tw-hud{position:absolute; top:var(--gap); left:calc(var(--side) + var(--gap)); right:var(--gap); display:flex; flex-wrap:wrap; gap:8px; pointer-events:none;}
.tw-chip{display:flex; align-items:center; gap:6px; margin:0; padding:7px 12px; border-radius:999px; background:rgba(255,253,248,.94); color:#2B2622; font-size:13px; box-shadow:0 4px 14px rgba(40,50,30,.14);}
.tw-dot{width:8px; height:8px; border-radius:50%; background:#5FA05F; box-shadow:0 0 0 0 rgba(95,160,95,.5); animation:tw-pulse 2s infinite;}
@keyframes tw-pulse{70%{box-shadow:0 0 0 8px rgba(95,160,95,0);} 100%{box-shadow:0 0 0 0 rgba(95,160,95,0);}}
.tw-back{pointer-events:auto; padding:0; font-weight:700;}
.tw-back a{display:block; padding:7px 13px; color:inherit; text-decoration:none;}
.tw-back a:hover{text-decoration:underline;}
.tw-tiers{list-style:none; gap:12px;}
.tw-tiers:empty{display:none;}
.tw-tiers b{font-weight:700;}

.tw-controls{position:absolute; right:var(--gap); bottom:var(--gap); display:flex; gap:8px;}
.tw-stage:not(.tw-closed) #twSideBtn{display:none;}
.tw-btn[aria-expanded="true"]{background:#2F6B4F; color:#fff;}
.tw-btn{display:inline-flex; align-items:center; gap:6px; height:40px; min-width:40px; padding:0 14px; border:0; border-radius:999px; background:rgba(255,253,248,.96); color:#2B2622; font:600 14px/1 inherit; cursor:pointer; box-shadow:0 4px 14px rgba(40,50,30,.16);}
.tw-btn svg{width:18px; height:18px;}
.tw-btn-icon{justify-content:center; padding:0;}
.tw-btn:hover{background:#fff;}
.tw-btn:focus-visible{outline:3px solid var(--accent); outline-offset:2px;}
.tw-hint{position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); margin:0; padding:10px 16px; border-radius:12px; background:rgba(38,48,61,.82); color:#fff; font-size:14px; pointer-events:none;}

.tw-card{position:absolute; left:calc(var(--side) + var(--gap)); bottom:var(--gap); z-index:5; width:min(360px, calc(100% - var(--side) - 2 * var(--gap))); padding:16px 16px 14px; border-radius:18px; background:rgba(255,253,248,.97); color:#2B2622; box-shadow:0 14px 30px rgba(38,48,61,.22);}
.tw-card h3{margin:2px 28px 4px 0; font-size:19px; line-height:1.2;}
.tw-card-kicker{margin:0; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#A87B2E;}
.tw-card-line{margin:0; font-size:14px; color:#5C5650;}
.tw-close{position:absolute; top:8px; right:8px; width:32px; height:32px; border:0; border-radius:50%; background:transparent; color:#5C5650; font-size:22px; line-height:1; cursor:pointer;}
.tw-close:hover{background:rgba(0,0,0,.06);}
.tw-thumbs{display:flex; gap:6px; margin-top:12px; overflow-x:auto; padding-bottom:2px;}
.tw-thumb{flex:0 0 auto;}
.tw-thumb img{display:block; width:52px; height:52px; border-radius:10px; object-fit:cover; background:#EEE6D8;}
.tw-cat{display:flex; gap:12px; align-items:center;}
.tw-cat img{width:84px; height:84px; flex:0 0 auto; border-radius:14px; object-fit:cover; background:#EEE6D8;}
.tw-link{display:inline-block; margin-top:12px; padding:0; border:0; background:none; color:#A87B2E; font:700 14px/1.3 inherit; cursor:pointer; text-decoration:none; word-break:break-all;}
.tw-link:hover{text-decoration:underline;}

.tw-sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}

/* The list of players floats on the island, like the Live Map's cat list. */
.tw-side{
  position:absolute; top:var(--gap); left:var(--gap); bottom:var(--gap); z-index:6; width:340px; display:flex; flex-direction:column; gap:12px;
  padding:16px 14px 14px; border-radius:22px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin;
  background:color-mix(in srgb, var(--page-bg) 92%, transparent);
  -webkit-backdrop-filter:blur(14px) saturate(1.3); backdrop-filter:blur(14px) saturate(1.3);
  box-shadow:0 10px 30px rgba(15,20,40,.22);
}
.tw-closed .tw-side{display:none;}
.tw-side-x{position:absolute; top:12px; right:10px; display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:50%; background:rgba(90,82,72,.1); color:var(--ink2); font-size:22px; line-height:1; cursor:pointer;}
.tw-side-x:hover{background:rgba(90,82,72,.18);}
.tw-side-title{margin:2px 40px 0 2px; font-family:'Fraunces',Georgia,serif; font-size:20px; font-weight:600; color:var(--ink);}
.tw-find input{width:100%; height:40px; padding:0 14px; border:1px solid var(--rule); border-radius:999px; background:var(--paper); color:var(--ink); font:inherit; font-size:14.5px;}
.tw-about{margin-top:auto; font-size:13.5px; color:var(--ink2);}
.tw-about summary{cursor:pointer; font-weight:700; padding:4px 2px;}
.tw-list{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:minmax(0,1fr); gap:8px;}
.tw-list button{display:flex; align-items:center; gap:10px; width:100%; padding:10px 12px; border:1px solid var(--rule); border-radius:16px; background:var(--paper); color:var(--ink); font:inherit; text-align:left; cursor:pointer; box-shadow:var(--shadow-card);}
.tw-list button:hover, .tw-list button[aria-current="true"]{border-color:var(--accent);}
.tw-list button:focus-visible{outline:3px solid var(--accent); outline-offset:2px;}
.tw-av{font-size:26px; line-height:1;}
.tw-who{flex:1 1 auto; min-width:0; display:flex; flex-direction:column;}
.tw-who b{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.tw-who small, .tw-num small{color:var(--ink3); font-size:12.5px;}
.tw-num{display:flex; flex-direction:column; align-items:flex-end; min-width:46px;}
.tw-none{color:var(--ink2); padding:8px 0;}
.tw-legend{margin:8px 2px 0; color:var(--ink3); font-size:13.5px; line-height:1.55;}
.tw-legend a{color:var(--ink2);}

@media (min-width:901px){
  .tw-stage:not(.tw-closed){--side:354px;}
}
/* Smaller screens: the list is a drawer over the island, shut until asked for. */
@media (max-width:900px){
  .tw-stage{--gap:10px;}
  .tw-side{width:min(340px, calc(100% - 20px)); z-index:8;}
}
@media (max-width:600px){
  .tw-stage{height:calc(100svh - 62px - env(safe-area-inset-top,0px));}
  .tw-btn span{display:none;}
  .tw-btn{padding:0; justify-content:center;}
  .tw-card{bottom:64px;}
  #twSideBtn{padding:0 14px;}
  #twSideBtn span{display:inline;}
}
@media (prefers-reduced-motion: reduce){
  .tw-dot{animation:none;}
}
