/* Pin World's page. The shared look (colours, fonts, buttons, ribbons, chips) is in brand.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--pw-body); color: var(--pw-ink);
  background: linear-gradient(180deg, #5bbcec 0%, #9ad8f7 48%, #dff3fd 100%);
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

#globe { position: fixed; inset: 0; touch-action: none; cursor: grab; }   /* the globe gets pinch and drag, not the page */
body.moving #globe { cursor: grabbing; }

/* ---------- top: logo, day and counters, search ---------- */
#logo {
  position: fixed; z-index: 5; left: 16px; top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px;
  text-decoration: none; font: 400 30px/1 var(--pw-display); letter-spacing: .5px;
}
#logo img { width: 48px; height: 48px; filter: drop-shadow(0 3px 0 rgba(43, 29, 20, .45)); }

#hud {
  position: fixed; z-index: 4; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; user-select: none;
}
#hud .day { font-size: 30px; padding: 8px 28px 11px; }
#hud .day b { font-weight: 400; }
#hud .stats { display: flex; gap: 10px; }
#hud.bump .stats .pw-chip:first-child { animation: bump .5s ease; }
#hud .clock { display: inline-flex; align-items: center; gap: 4px; margin-left: 12px; padding-left: 12px; border-left: 3px solid rgba(43, 29, 20, .35); font-size: .8em; }
#hud .clock i { font-style: normal; font-size: .8em; }
#hud .event[hidden] { display: none; }   /* .pw-chip's display would show it otherwise */
#hud .event { height: auto; padding: 6px 16px 6px 5px; font-size: 20px; gap: 8px; }
#hud .event small { font-size: 15px; margin-left: 4px; }
@keyframes bump { 40% { transform: scale(1.14); } }

#search { position: fixed; z-index: 6; right: 16px; top: max(14px, env(safe-area-inset-top)); width: min(330px, calc(100vw - 32px)); }
#q {
  width: 100%; font: 800 16px var(--pw-body); color: var(--pw-ink); padding: 12px 16px 12px 44px; outline: none;
  border: 3px solid var(--pw-ink); border-radius: 16px; box-shadow: var(--pw-lift-sm);
  background: var(--pw-parch) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%232b1d14' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6.5'/%3E%3Cpath d='m14 14 5.5 5.5'/%3E%3C/svg%3E") no-repeat 13px center;
  -webkit-appearance: none; appearance: none;
}
#q::placeholder { color: var(--pw-ink-soft); }
#q:focus { background-color: #fff; box-shadow: 0 0 0 4px var(--pw-gold), var(--pw-lift-sm); }
#results {
  list-style: none; margin: 10px 0 0; padding: 6px; max-height: 55vh; overflow: auto;
  background: var(--pw-parch); border: 3px solid var(--pw-ink); border-radius: 16px; box-shadow: var(--pw-lift);
}
#results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
#results .fl { font-size: 20px; }
#results .lb { font: 400 17px var(--pw-game); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results li small { margin-left: auto; font: 800 13px var(--pw-body); color: var(--pw-ink-soft); white-space: nowrap; }
#results li.active, #results li:hover { background: var(--pw-gold-light); }
#results .empty { font: 800 15px var(--pw-body); color: var(--pw-ink-soft); cursor: default; }

/* ---------- bottom: the dock and zoom ---------- */
#dock {
  position: fixed; z-index: 5; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 10px; padding: 9px 10px 11px;
  background: linear-gradient(180deg, #c27a3e, var(--pw-wood) 50%, #94552a); border: 3px solid var(--pw-ink); border-radius: 22px;
  box-shadow: inset 0 3px 0 rgba(255, 220, 170, .35), inset 0 -4px 0 var(--pw-wood-dark), var(--pw-lift);
}
#dock .pw-btn { flex-direction: column; gap: 4px; min-width: 88px; padding: 7px 10px 9px; border-radius: 14px; }
#dock .pw-btn span { font-size: 25px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
#dock .pw-btn small { font: 400 14px/1 var(--pw-game); letter-spacing: .3px; }
#dock .join { animation: call 2.4s ease-in-out infinite; }
#dock #worldsBtn[hidden] { display:none; }
@keyframes call { 0%, 70%, 100% { box-shadow: inset 0 -5px 0 var(--c2), 0 4px 0 var(--pw-ink), 0 0 0 0 rgba(255, 201, 40, .0); }
  85% { box-shadow: inset 0 -5px 0 var(--c2), 0 4px 0 var(--pw-ink), 0 0 0 9px rgba(255, 230, 128, .55); } }

#zoom { position: fixed; z-index: 5; right: 16px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
#zoom .pw-btn { width: 50px; height: 50px; padding: 0 0 4px; font: 400 30px/1 var(--pw-game); }

/* ---------- panels ---------- */
.sheet { position: fixed; z-index: 7; padding: 20px 18px 18px; }
/* panels that scroll: the stitched edge is an outline, so it stays on the panel's edge instead of
   scrolling away with the list (a ::before would end halfway down as a dotted line) */
.sheet::before { display: none; }
.sheet { outline: 2px dashed rgba(150, 100, 50, .45); outline-offset: -9px; }
.sheet[hidden] { display: none; }
.sheet:not([hidden]) { animation: rise .26s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.close {
  position: absolute; z-index: 2; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--pw-ink); background: var(--pw-red); color: #fff; font: 400 24px/1 var(--pw-game); padding: 0 0 3px;
  box-shadow: inset 0 -3px 0 var(--pw-red-dark), 0 2px 0 var(--pw-ink);
}

#card { left: 16px; top: 82px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 200px); overflow: auto; }
#card .who { display: flex; gap: 14px; align-items: center; padding-right: 34px; }
.crest {   /* the big rank shield */
  --c: var(--pw-parch); flex: none; width: 60px; height: 68px; display: grid; place-items: center; font-size: 30px; position: relative;
  background: var(--pw-ink); clip-path: path("M30 0 L60 8 L60 32 C60 52 44 62 30 68 C16 62 0 52 0 32 L0 8 Z");
}
.crest::before {
  content: ""; position: absolute; inset: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, white) 0 45%, var(--c) 45%);
  clip-path: path("M26 0 L52 7 L52 28 C52 45 38 54 26 60 C14 54 0 45 0 28 L0 7 Z");
}
.crest span { position: relative; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.crest img.monument { display: block; width: 46px; height: 46px; object-fit: contain; margin-top: -4px; }
#card .id { min-width: 0; }
#card .name { display: block; font: 400 24px/1.1 var(--pw-game); color: var(--pw-ink); text-decoration: none; overflow-wrap: anywhere; }
#card a.name[href]:hover { text-decoration: underline; }
#card .where { margin-top: 4px; font: 800 15px var(--pw-body); color: var(--pw-ink-soft); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.titles { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }
.titles li {
  font: 400 15px/1 var(--pw-game); padding: 7px 11px 8px; border-radius: 10px; border: 2.5px solid var(--pw-ink);
  background: var(--c); color: var(--t); box-shadow: inset 0 -3px 0 var(--c2), 0 2px 0 var(--pw-ink);
}
.titles .ruler { --c: var(--pw-gold); --c2: var(--pw-gold-dark); --t: var(--pw-ink); }
.titles .national { --c: var(--pw-red); --c2: var(--pw-red-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); }
.titles .city { --c: var(--pw-blue); --c2: var(--pw-blue-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); }
.titles .job { --c: var(--pw-white); --c2: var(--pw-parch-edge); --t: var(--pw-ink); }
.titles .rare { --c: var(--pw-purple); --c2: var(--pw-purple-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); box-shadow: 0 0 12px 2px rgba(180, 130, 255, .7), 0 2px 0 var(--pw-ink); }
#card blockquote {   /* what they wrote, as a speech bubble */
  position: relative; margin: 16px 0 0; padding: 10px 14px 11px 40px; background: #fff; border: 2.5px solid var(--pw-ink);
  border-radius: 14px; font: 700 16px/1.35 var(--pw-body); overflow-wrap: anywhere;
}
#card blockquote::before { content: "💬"; position: absolute; left: 11px; top: 9px; font-size: 18px; }
#card blockquote[hidden] { display: none; }
#card .meta { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#card .meta div { background: rgba(255, 255, 255, .55); border: 2px solid rgba(43, 29, 20, .2); border-radius: 10px; padding: 7px 4px 6px; text-align: center; min-width: 0; }
#card .meta b { display: block; font: 400 17px/1.1 var(--pw-game); white-space: nowrap; }
#card .meta small { display: block; margin-top: 3px; font: 900 10px/1.1 var(--pw-body); letter-spacing: .5px; text-transform: uppercase; color: var(--pw-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#card .actions .pw-btn { flex: 1; min-width: 0; font-size: 16px; padding: 10px 8px 11px; }
#card .actions #cShare { flex: 1.6; min-height: 44px; white-space: nowrap; }
#card .actions #cStory { flex: 1 1 100%; font-size: 21px; padding: 14px 10px 15px; }
#card .actions #cStory:disabled { opacity: .75; }
#card .actions .pw-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#board { right: 16px; top: 82px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 200px); overflow: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 40px 12px 0; }
.tabs button {
  flex: 1; padding: 8px 4px 9px; border: 2.5px solid var(--pw-ink); border-radius: 12px; cursor: pointer; white-space: nowrap;
  background: var(--pw-white); font: 400 14px/1 var(--pw-game); box-shadow: 0 2px 0 var(--pw-ink);
}
.tabs button[aria-selected="true"] { background: var(--pw-gold); box-shadow: inset 0 -3px 0 var(--pw-gold-dark), 0 2px 0 var(--pw-ink); }
.platforms { display: flex; gap: 14px; margin: 0 0 10px; font: 400 16px var(--pw-game); }
.platforms span { display: inline-flex; align-items: center; gap: 6px; }
.list { margin: 0; padding: 0; list-style: none; }
.list[hidden] { display: none; }
.list li { display: flex; gap: 9px; align-items: center; padding: 8px 9px; border-radius: 10px; cursor: pointer; }
.list li:hover { background: var(--pw-gold-light); }
.list .num { width: 24px; font: 400 16px var(--pw-game); color: var(--pw-ink-soft); text-align: right; }
.list .fl { font-size: 20px; }
.list .lb { font: 400 17px var(--pw-game); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list .lb i { display: block; margin-top: 2px; font: 800 12.5px var(--pw-body); font-style: normal; color: var(--pw-ink-soft); overflow: hidden; text-overflow: ellipsis; }
.list li small { margin-left: auto; font: 800 13px var(--pw-body); color: var(--pw-ink-soft); white-space: nowrap; }
.free-head { font: 800 15px/1.4 var(--pw-body); margin: 0 0 10px; }
.free-head b { font: 400 22px var(--pw-game); color: var(--pw-red); }
.free-head a { color: var(--pw-red); font-weight: 900; }
.country-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.country-head .back { flex: none; width: 38px; height: 38px; padding: 0 0 3px; font: 400 22px/1 var(--pw-game); }
.country-head .fl { font-size: 30px; }
.country-head b { display: block; font: 400 22px/1.1 var(--pw-display); }
.country-head small { display: block; margin-top: 2px; font: 800 13px var(--pw-body); color: var(--pw-ink-soft); }
.list .more { justify-content: center; font: 800 13px var(--pw-body); color: var(--pw-ink-soft); cursor: default; }
.list .more:hover { background: none; }
.thrones { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.thrones li { font: 400 14px/1 var(--pw-game); padding: 6px 9px 7px; border-radius: 9px; border: 2px dashed var(--pw-ink-soft); color: var(--pw-ink-soft); background: rgba(255, 255, 255, .5); }

#join { left: 50%; transform: translateX(-50%); bottom: 130px; width: min(440px, calc(100vw - 32px)); text-align: center; }
#join:not([hidden]) { animation: rise-c .26s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes rise-c { from { transform: translate(-50%, 24px); opacity: 0; } }
#join .pw-ribbon { margin-top: 2px; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; font: 800 16px/1.3 var(--pw-body); }
.steps b {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 400 19px/1 var(--pw-game);
  background: var(--pw-gold); border: 2.5px solid var(--pw-ink); box-shadow: 0 2px 0 var(--pw-ink);
}
.rule { margin: 14px 0 0; padding: 10px 12px; background: rgba(255, 255, 255, .6); border-radius: 12px; font: 700 14px/1.45 var(--pw-body); text-align: left; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials .pw-btn { flex: 1; font-size: 16px; padding: 10px 6px 11px; text-decoration: none; }
.socials .tt { --c: #222; --c2: #000; --t: #fff; }
.socials .yt { --c: #ff2d2d; --c2: #b80d0d; --t: #fff; }
.socials .ig { --c: #d6249f; --c2: #8f1469; --t: #fff; }

/* ---------- on the map: name tags, kingdoms, towns ---------- */
/* each label is a zero-size anchor at the exact spot; what you see sits above it */
.pin, .kingdom, .place, .citylabel { width: 0; height: 0; position: relative; }
.pin .tag {
  --c: var(--pw-white); --c2: var(--pw-parch-edge); --t: var(--pw-ink);
  position: absolute; left: 0; bottom: var(--lift, 12px); transform: translateX(calc(-50% + var(--dx, 0px))); transform-origin: 50% 100%;
  display: flex; align-items: center; gap: 5px; white-space: nowrap; pointer-events: none;
  font: 400 14px/1 var(--pw-game); letter-spacing: .2px; color: var(--t);
  padding: 2px 8px 2px 2px; border: 2.5px solid var(--pw-ink); border-radius: 12px; background: var(--c);
  box-shadow: inset 0 -3px 0 var(--c2), 0 3px 0 var(--pw-ink);
  animation: pop .24s cubic-bezier(.3, 1.6, .6, 1);
}
.pin .tag::after {   /* the point down to the house */
  content: ""; position: absolute; left: calc(50% - var(--dx, 0px)); bottom: -10px; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--pw-ink); border-bottom: 0;
}
.pin .nm { padding-bottom: 1px; }
.pin .pw-shield { width: 25px; height: 28px; font-size: 13px; clip-path: path("M12.5 0 L25 3.3 L25 13.3 C25 21.6 18.3 25.8 12.5 28 C6.7 25.8 0 21.6 0 13.3 L0 3.3 Z"); }
.pin .pw-shield::before { inset: 2px; clip-path: path("M10.5 0 L21 2.8 L21 11.2 C21 18.2 15.4 21.7 10.5 24 C5.6 21.7 0 18.2 0 11.2 L0 2.8 Z"); }
.pin.r3 .tag { --c: var(--pw-gold); --c2: var(--pw-gold-dark); font-size: 16px; padding: 3px 10px 3px 3px; bottom: var(--lift, 28px); }   /* above the castle, not over it */
.pin.r3 .pw-shield { --c: var(--pw-white); }
.pin.r2 .tag { --c: var(--pw-red); --c2: var(--pw-red-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); }
.pin.r1 .tag { --c: var(--pw-blue); --c2: var(--pw-blue-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); }
.pin.r2 .pw-shield, .pin.r1 .pw-shield { --c: var(--pw-white); text-shadow: none; }
.pin.rare .tag { --c: var(--pw-purple); --c2: var(--pw-purple-dark); --t: #fff; text-shadow: 0 1.5px 0 var(--pw-ink); box-shadow: 0 0 12px 3px rgba(190, 140, 255, .85), 0 3px 0 var(--pw-ink); }
.pin.hit .tag { animation: hit 1s ease 2; }
/* followers shine: a gold frame and glow, and the blue check after the name (static: no animation, cheap on phones) */
.pin.fo .tag { border-color: #ffd23f; box-shadow: inset 0 -3px 0 var(--c2), 0 0 0 2px var(--pw-ink), 0 0 12px 3px rgba(255, 196, 40, .95), 0 3px 0 var(--pw-ink); }
.pin .vf, #cName .vf {   /* the blue verified check after a follower's name */
  flex: none; width: 15px; height: 15px; margin-left: -2px; border-radius: 50%; background: #1d9bf0;
  box-shadow: 0 0 0 1.5px #fff; position: relative;
}
.pin .vf::after, #cName .vf::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pin .vf { position: absolute; top: -10px; right: -10px; width: 19px; height: 19px; margin: 0; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.5); }   /* on the tag's top-right corner */
.pin .vf::after { left: 6px; top: 3px; width: 4.5px; height: 9px; border-width: 0 2.5px 2.5px 0; }
#cName .vf { display: inline-block; vertical-align: middle; margin-left: 6px; width: 20px; height: 20px; }
#cName .vf::after { left: 6.5px; top: 3.5px; width: 4.5px; height: 9px; border-width: 0 2.5px 2.5px 0; }
@keyframes pop { from { transform: translateX(calc(-50% + var(--dx, 0px))) scale(.4); opacity: 0; } }
@keyframes hit { 50% { transform: translateX(calc(-50% + var(--dx, 0px))) scale(1.3); } }

/* platform badges: TikTok, Instagram, YouTube, small enough not to fight the name */
.pf { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; flex: none; text-shadow: none;
  font: 900 10px/1 -apple-system, "Helvetica Neue", Arial, sans-serif; color: #fff; border: 1.5px solid var(--pw-ink); }
.pf.tt { background: #111; box-shadow: -1px 0 0 #25f4ee, 1px 0 0 #fe2c55; }
.pf.ig { background: radial-gradient(circle at 30% 110%, #fdcb52 0%, #fd5949 45%, #d6249f 65%, #285aeb 100%); border-radius: 5px; }
.pf.yt { background: #ff0033; border-radius: 5px; font-size: 8px; padding-left: 1px; }

/* a kingdom seen from far away: its castle and a gold banner with the ruler */
.kingdom > div {
  position: absolute; left: 0; bottom: -4px; transform: translateX(-50%); transform-origin: 50% 100%;
  --dx: inherit;
  display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: pop .3s cubic-bezier(.3, 1.6, .6, 1);
}
.kingdom img { width: 40px; height: 40px; margin-bottom: -9px; position: relative; z-index: 1; filter: drop-shadow(0 3px 0 rgba(43, 29, 20, .45)); }
.kingdom .banner {
  display: block; text-align: center; white-space: nowrap; padding: 6px 11px 6px; border: 2.5px solid var(--pw-ink); border-radius: 10px;
  transform: translateX(var(--dx, 0px));
  background: linear-gradient(180deg, var(--pw-gold-light) 0 45%, var(--pw-gold) 45%); box-shadow: inset 0 -3px 0 var(--pw-gold-dark), 0 3px 0 var(--pw-ink);
}
.kingdom b { display: block; font: 400 16px/1.05 var(--pw-display); }
.kingdom small { display: block; margin-top: 2px; font: 400 12px/1 var(--pw-game); color: #7a4a00; }
/* on a phone: a small tag (flag and country, one ruler under it) so a few kingdoms do not cover the globe */
.kingdom.compact img { width: 26px; height: 26px; margin-bottom: -2px; }
.kingdom.compact .banner { padding: 3px 8px 4px; border-width: 2px; border-radius: 8px; box-shadow: inset 0 -2px 0 var(--pw-gold-dark), 0 2px 0 var(--pw-ink); }
.kingdom.compact b { font-size: 13px; }
.kingdom.compact small { margin-top: 1px; font-size: 10.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* towns with residents: a big name and how many live there */
.citylabel > div {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-50% + var(--dy, 0px))); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; line-height: 1; white-space: nowrap; animation: fade .3s ease;
}
.citylabel b { font: 400 25px/1 var(--pw-display); letter-spacing: .5px; color: #fff;
  text-shadow: -2px -2px 0 var(--pw-ink), 2px -2px 0 var(--pw-ink), -2px 2px 0 var(--pw-ink), 2px 2px 0 var(--pw-ink), 0 -2px 0 var(--pw-ink), 0 2px 0 var(--pw-ink), -2px 0 0 var(--pw-ink), 2px 0 0 var(--pw-ink), 0 4px 0 var(--pw-ink); }
.citylabel small { margin-top: 5px; font: 400 13px/1 var(--pw-game); padding: 3px 8px 4px; border-radius: 8px; background: var(--pw-parch); border: 2px solid var(--pw-ink); }
@keyframes fade { from { opacity: 0; } }

/* the world's other towns: plain, so they never compete with the settlers */
.place > div { position: absolute; left: -4px; top: 0; transform: translateY(-50%); pointer-events: none; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.place i { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--pw-ink); flex: none; }
.place.cap i { width: 10px; height: 10px; border-radius: 2px; background: var(--pw-red); }
.place span { font: 800 13px var(--pw-body); color: #1f3b2a;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff, 0 0 4px #fff; }
.place.cap span { font-weight: 900; }

/* ---------- toast, loading, badge ---------- */
#toast {
  position: fixed; z-index: 9; left: 50%; bottom: 128px; transform: translateX(-50%); max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 16px;
  background: rgba(43, 29, 20, .92); color: #fff; font: 400 17px/1.2 var(--pw-game); border: 3px solid var(--pw-gold);
  box-shadow: var(--pw-lift);
}
#toast.in { animation: rise-c .3s cubic-bezier(.2, 1.4, .5, 1); }
#toast .pw-btn { padding: 7px 12px 8px; font-size: 15px; flex: none; }
#toast[hidden] { display: none; }
#ticker {   /* new settlers: small, under the Day label, out of the way */
  position: fixed; z-index: 8; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 114px); max-width: calc(100vw - 24px);
  padding: 4px 10px 5px; border-radius: 999px; border: 2px solid rgba(255, 210, 63, .7);
  background: rgba(43, 29, 20, .78); color: #fff; font: 400 13px/1.2 var(--pw-game); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
#ticker.go { pointer-events: auto; cursor: pointer; }
#ticker.in { animation: ticker-in .25s ease-out; }
#ticker[hidden] { display: none; }
@keyframes ticker-in { from { transform: translateY(-6px); opacity: 0; } }
body.sheet-open #ticker, body.daily-on #ticker { display: none; }

#loading {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: linear-gradient(180deg, #5bbcec 0%, #9ad8f7 55%, #dff3fd 100%); transition: opacity .6s; font: 400 26px var(--pw-display);
}
#loading img { width: 110px; height: 110px; animation: hop 1s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(43, 29, 20, .35)); }
@keyframes hop { 50% { transform: translateY(-14px) rotate(-3deg); } }
#loading.done { opacity: 0; pointer-events: none; }

.sample-badge[hidden] { display: none; }
.sample-badge {
  position: fixed; z-index: 4; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); font: 800 12px var(--pw-body);
  color: var(--pw-ink); background: rgba(255, 244, 214, .9); padding: 4px 10px; border-radius: 8px; border: 2px solid var(--pw-ink);
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  #logo { left: 12px; top: max(10px, env(safe-area-inset-top)); }
  #logo img { width: 44px; height: 44px; }
  #logo span { display: none; }
  #search { left: 64px; right: 12px; width: auto; top: max(12px, env(safe-area-inset-top)); }
  #q { padding: 11px 14px 11px 42px; font-size: 16px; }
  #hud { top: calc(max(10px, env(safe-area-inset-top)) + 58px); gap: 6px; flex-direction: row; width: calc(100% - 24px); justify-content: space-between; }
  #hud .day { font-size: 17px; padding: 5px 10px 7px; margin: 0 8px; }
  #hud .stats { gap: 6px; }
  #hud .pw-chip { height: 30px; font-size: 15px; padding: 0 8px 0 3px; gap: 4px; }
  #hud .pw-chip > i { width: 25px; height: 25px; font-size: 14px; }
  #hud .pw-chip small { display: none; }
  #hud .clock { margin-left: 8px; padding-left: 8px; }
  #hud .event { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; white-space: nowrap; font-size: 15px; }
  #hud .event small { display: inline; font-size: 13px; }
  #dock { left: 10px; right: 10px; transform: none; gap: 7px; padding: 7px 8px 9px; bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 20px; }
  #dock .pw-btn { flex: 1; min-width: 0; min-height: 48px; padding: 4px 2px 6px; }
  #dock .pw-btn span { font-size: 20px; }
  #dock .pw-btn small { font-size: 12px; }
  #zoom { display: none; }
  .sample-badge { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 106px); left: 50%; transform: translateX(-50%); }
  /* panels become sheets from the bottom, over the dock */
  .sheet, #card, #board, #join, #wishlist {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none; max-height: 72vh; overflow: auto;
    border-radius: 24px 24px 0 0; border-bottom: 0; padding: 20px 16px max(18px, env(safe-area-inset-bottom));
  }
  .sheet:not([hidden]), #join:not([hidden]) { animation: sheet .3s cubic-bezier(.2, 1.1, .4, 1); }
  @keyframes sheet { from { transform: translateY(100%); } }
  #card .name { font-size: 22px; }
  #card .meta { grid-template-columns: repeat(2, 1fr); }
  #toast { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 96px); font-size: 16px; }
  body.sheet-open #toast { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 110px); }
  .citylabel b { font-size: 21px; }
}
@media (max-width: 760px), (pointer: coarse) {
  .pin .tag, .pin.r3 .tag {
    max-width: 128px; gap: 3px; padding: 2px 6px 2px 3px; border-width: 1.5px; border-radius: 8px;
    font-size: 11px; letter-spacing: 0; box-shadow: inset 0 -2px 0 var(--c2), 0 2px 0 var(--pw-ink);
  }
  .pin.r3 .tag { max-width: 144px; font-size: 12px; }
  .pin .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .pin .pw-shield { flex: none; width: 18px; height: 20px; font-size: 10px;
    clip-path: polygon(0 0, 100% 12%, 100% 50%, 87% 75%, 50% 100%, 13% 75%, 0 50%); }
  .pin .pw-shield::before { inset: 1.5px; clip-path: inherit; }
  .pin .pf { width: 12px; height: 12px; font-size: 8px; border-width: 1px; }
  .pin .pf.yt { font-size: 6px; }
  .pin .tag::after { bottom: -6px; border-width: 4px; border-bottom: 0; }
  .pin.fo .tag { box-shadow: inset 0 -2px 0 var(--c2), 0 0 0 1px var(--pw-ink), 0 2px 0 var(--pw-ink); }
  .pin.rare .tag { box-shadow: 0 0 5px 1px rgba(190, 140, 255, .6), 0 2px 0 var(--pw-ink); }
  .pin .vf { top: -5px; right: -4px; width: 12px; height: 12px; box-shadow: 0 0 0 1px #fff; }
  .pin .vf::after { left: 4px; top: 1px; width: 2.5px; height: 6px; border-width: 0 1.5px 1.5px 0; }
}
@media (max-width: 370px) {
  #hud .day { font-size: 15px; padding: 5px 8px 7px; margin: 0 6px; }
  #hud .clock { margin-left: 5px; padding-left: 5px; }
  #hud .pw-chip { font-size: 13px; padding-right: 6px; }
  #dock { gap: 3px; padding-left: 5px; padding-right: 5px; }
  #dock .pw-btn small { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* the map data's credit (OpenStreetMap's licence asks for it), small and out of the way */
#credit { position: fixed; z-index: 3; right: 6px; bottom: 2px; font: 600 10px/1.2 var(--pw-body); color: rgba(43, 29, 20, 0.55); text-decoration: none; }
@media (max-width: 760px) { #credit { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 84px); right: 12px; } }   /* just above the dock */

/* ---------- world events: the card, the "Live now" list, the chip, the debug clock ---------- */
#ecard { left: 16px; top: 82px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 200px); overflow: auto; }
/* on a laptop with the events list (bottom left) the card goes right, so neither covers the other or the event */
body.has-evdock #ecard { left: auto; right: 16px; top: 82px; bottom: auto; max-height: calc(100vh - 290px); }   /* right, under the search, above the zoom buttons: the event stays in view */
#ecard .who { display: flex; gap: 14px; align-items: center; padding-right: 34px; }
#ecard .id { min-width: 0; }
#ecard .name { display: block; font: 400 24px/1.1 var(--pw-game); color: var(--pw-ink); overflow-wrap: anywhere; }
#ecard .where { margin-top: 4px; font: 800 15px var(--pw-body); color: var(--pw-ink-soft); }
/* the events list, bottom left: five at a time, the rest a scroll away; on a phone a button above the dock that opens it */
.evdock { position: fixed; z-index: 6; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 300px;
  background: var(--pw-parch); border: 3px solid var(--pw-ink); border-radius: 18px; box-shadow: 0 5px 0 rgba(43, 29, 20, .55), 0 10px 24px rgba(0, 0, 0, .25); overflow: hidden; }
.evdock[hidden] { display: none; }
.evhead { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px 8px; border: 0; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, #c27a3e, var(--pw-wood) 60%, #94552a); color: #fff8e6; font: 400 18px var(--pw-game); text-shadow: 0 2px 0 rgba(43, 29, 20, .6); }
.evhead .ic { font-size: 18px; }
.evhead .cnt { margin-left: auto; min-width: 26px; padding: 1px 8px 2px; border-radius: 999px; background: var(--pw-gold); color: var(--pw-ink); border: 2px solid var(--pw-ink); font: 900 13px var(--pw-body); text-shadow: none; text-align: center; }
.evhead .chev { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #fff8e6; transition: transform .2s; }
.evdock.closed .evhead .chev { transform: rotate(180deg); }
.evdock.closed .evlist { display: none; }
.evdock.closed .callrow.called { display: none; }   /* (once you have called, the row waits inside the opened list) */
.evtabs { display: flex; gap: 6px; padding: 6px 6px 0; }
.evdock.closed .evtabs { display: none; }
.evtabs button { flex: 1; min-height: 38px; padding: 0 4px; border: 2px solid var(--pw-ink); border-radius: 10px; cursor: pointer; background: var(--pw-parch-2); color: var(--pw-ink);
  font: 400 15px/1 var(--pw-game); box-shadow: 0 2px 0 rgba(43, 29, 20, .45); }
.evtabs button span { margin-left: 3px; font: 900 12px var(--pw-body); opacity: .7; }
.evtabs button[aria-selected="true"] { background: var(--pw-gold); box-shadow: inset 0 -3px 0 var(--pw-gold-dark), 0 2px 0 rgba(43, 29, 20, .45); }
.evtabs button[aria-selected="true"] span { opacity: 1; }
.evtabs button:focus-visible { outline: 3px solid var(--pw-blue); outline-offset: 1px; }
.evlist { margin: 0; padding: 4px 6px 6px; list-style: none; height: min(calc(var(--evrows, 5) * 64px + 10px), 286px); overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y proximity; scrollbar-width: thin; scrollbar-color: var(--pw-wood) transparent; }
.evlist li { display: flex; align-items: center; gap: 10px; height: 64px; box-sizing: border-box; padding: 6px 8px; border-radius: 12px; cursor: pointer; scroll-snap-align: start; }
.evlist li + li { border-top: 2px dashed rgba(43, 29, 20, .14); }
.evlist li:hover, .evlist li:focus-visible { background: var(--pw-gold-light); outline: none; }
.evlist .fg { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 25px; line-height: 1; }
.evlist .tx { flex: 1; min-width: 0; }
.evlist .tx b { display: block; font: 400 16px/1.1 var(--pw-game); color: var(--pw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evlist .tx i { display: block; margin-top: 1px; font: 800 11.5px/1.2 var(--pw-body); font-style: normal; color: var(--pw-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evlist .bar { height: 15px; margin-top: 4px; border-width: 2px; }
.evlist .bar > small { font-size: 10.5px; }
.evlist .sig { flex: none; font-size: 17px; opacity: .85; }
.evlist li.empty { display: block; height: auto; padding: 14px 10px; cursor: default; text-align: center; font: 800 13px/1.35 var(--pw-body); color: var(--pw-ink-soft); }
.evlist li.empty:hover { background: none; }
.evlist li.built .tx i + i { margin-top: 0; color: var(--pw-wood-dark); }
@media (max-width: 760px) {
  .evdock { left: 8px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 84px); width: auto; max-width: calc(100vw - 16px); border-radius: 16px; }
  .evdock:not(.closed) { right: 8px; }
  .evdock.closed .callrow { display: none; }   /* the race invitation lives inside Events on a phone */
  .evhead { min-height: 44px; padding: 7px 11px; font-size: 16px; }
  .evtabs button { min-height: 42px; font-size: 16px; }
  .evlist { height: min(calc(var(--evrows, 5) * 60px + 10px), 262px, 40vh); max-height: none; }
  .evlist li { height: 60px; }
  body.sheet-open .evdock { display: none; }
}

/* the events' loading bars: a sunken dark track, a gold fill with stripes that slide while it is under way,
   green when done (the map's plaque in eventlayer.js draws the same) */
.loadbar { position: relative; display: block; overflow: hidden; border: 2.5px solid var(--pw-ink); border-radius: 999px;
  background: #1e140c; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5); }
.loadbar > b, .loadbar > div { position: relative; display: block; height: 100%; width: 0; min-width: 0; border-radius: 999px; overflow: hidden;
  background: linear-gradient(180deg, #fff0a0 0, #ffc928 45%, #d99400 100%); transition: width .4s; }
.loadbar > b::before, .loadbar > div::before { content: ''; position: absolute; left: 0; right: 0; top: 2px; height: 22%; border-radius: 999px; background: rgba(255, 255, 255, .45); }
.loadbar > b::after, .loadbar > div::after { content: ''; position: absolute; top: 0; bottom: 0; left: -24px; right: 0;
  background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .3) 0 5px, transparent 5px 12px); animation: pw-stripes 1.1s linear infinite; }
.loadbar.done > b, .loadbar.done > div { background: linear-gradient(180deg, #a6ec8a 0, #5cc04a 50%, #2f8a3a 100%); }
.loadbar.done > b::after, .loadbar.done > div::after, .loadbar.soon > b::after { animation: none; }
@keyframes pw-stripes { to { transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { .loadbar > b::after, .loadbar > div::after { animation: none; } }
.loadbar > small, .loadbar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fffaf0;
  font: 900 11px/1 var(--pw-body); letter-spacing: .3px; text-shadow: -1px -1px 0 #1d130b, 1px -1px 0 #1d130b, -1px 1px 0 #1d130b, 1px 1px 0 #1d130b; pointer-events: none; }
.eprogress { margin-top: 14px; height: 24px; }
.eprogress > span { font-size: 13px; }
.estage { margin-top: 8px; font: 400 17px var(--pw-game); color: var(--pw-ink); }
.enotice { margin: 10px 0 0; font: 800 14px/1.4 var(--pw-body); }
#ecard .meta { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#ecard .meta div { background: rgba(255, 255, 255, .55); border: 2px solid rgba(43, 29, 20, .2); border-radius: 10px; padding: 7px 4px 6px; text-align: center; min-width: 0; }
#ecard .meta b { display: block; font: 400 17px/1.1 var(--pw-game); white-space: nowrap; }
#ecard .meta small { display: block; margin-top: 3px; font: 900 10px/1.1 var(--pw-body); letter-spacing: .5px; text-transform: uppercase; color: var(--pw-ink-soft); }
#ecard .actions { display: flex; gap: 10px; margin-top: 16px; }
#ecard .actions .pw-btn { flex: 1; font-size: 16px; padding: 10px 8px 11px; }
.timectl { position: fixed; z-index: 9; right: 16px; top: 78px; display: flex; gap: 4px; align-items: center; padding: 6px 8px;
  background: rgba(43, 29, 20, .88); color: #fffaf0; border-radius: 12px; font: 400 13px var(--pw-game); }
.timectl[hidden] { display: none; }
.timectl b { font-weight: 400; margin-right: 4px; white-space: nowrap; }
.timectl button { font: 400 12px var(--pw-game); color: var(--pw-ink); padding: 3px 6px; border-radius: 7px; border: 2px solid #2b1d14; background: var(--pw-parch); cursor: pointer; }
.timectl button.on { background: var(--pw-gold); }
@media (max-width: 760px) {
  #ecard, body.has-evdock #ecard { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 50dvh; border-radius: 24px 24px 0 0; }
  #ecard .name { font-size: 20px; }
  #ecard .meta { display: none; }   /* progress and time already appear above; keep the artwork in view */
  .tabs { overflow-x: auto; margin-right: 44px; }
  .tabs button { flex: none; padding: 8px 9px 9px; font-size: 13px; }
  .timectl { top: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 84px); left: 8px; right: 8px; flex-wrap: wrap; }
  body.sheet-open .timectl { display: none; }
}

/* a ruler who does not follow @pinworld.online yet: the card warns them (the Dethroning, Fri 23 Oct) */
#card .risk { display: block; margin: 2px 0 10px; padding: 8px 10px; border-radius: 10px; font: 800 14px/1.25 var(--pw-body); text-decoration: none; color: #fff; background: var(--pw-red); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
#card .risk[hidden] { display: none; }
/* the banner line on a settler's card: raised for a follower, a friendly ask for the rest */
#card .follow { margin: 12px 0 0; padding: 7px 10px 8px; border-radius: 10px; font: 800 14px/1.3 var(--pw-body); color: var(--pw-ink); background: rgba(255, 255, 255, .55); border: 2px solid rgba(43, 29, 20, .2); }
#card .follow.on { background: var(--pw-gold); border-color: var(--pw-gold-dark); }
#card .follow a { color: var(--pw-red-dark); font-weight: 900; }
#card .follow[hidden] { display: none; }
/* the house level line: Level N, how many videos it took and what is next (levels.py) */
#card .level { margin: 8px 0 0; font: 800 14px/1.3 var(--pw-body); color: var(--pw-ink); }
#card .level b { color: var(--pw-red-dark); font-weight: 900; }
#card .level small { font: 700 13px/1.3 var(--pw-body); opacity: .75; }
@media (min-width: 761px) {   /* on phones it is a bottom sheet like the other panels (the 760px rules above) */
  #wishlist { right: 16px; top: 82px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 200px); overflow: auto; }
}
#wishlist .pw-ribbon { margin: 2px 40px 12px; }
.wishes .free-head b { display: block; font-size: 19px; margin-bottom: 2px; }
.wishes .free-head a { color: var(--pw-red); font-weight: 900; }
.wishes li { align-items: flex-start; content-visibility: auto; contain-intrinsic-size: auto 98px; }   /* rows off screen cost no layout or paint: 90 rows are no heavier than 60 were */
/* the newest wishes under the top list; a wish only non-followers made is greyed and says "follow to make it count" */
.wishes .free-head.newest { margin-top: 16px; }
.wishes .wish-find { display: block; width: 100%; box-sizing: border-box; height: 42px; margin: 4px 0 8px; padding: 0 12px; border: 2.5px solid var(--pw-ink); border-radius: 12px; background: #fff; font: 800 16px var(--pw-body); color: var(--pw-ink); outline: none; }
.wishes .wish-find:focus { box-shadow: 0 0 0 3px var(--pw-gold); }
.wishes ol.found[hidden] { display: none; }
.wishes.searching > .top, .wishes.searching > .newest { display: none; }   /* while searching, only the box and its answers */
.wishes ol.newest .num, .wishes ol.found .num { display: none; }
.wishes li.grey { opacity: .62; }
.wishes li.grey .st { color: var(--pw-red-dark); font-weight: 800; }
.wishes .lb { flex: 1; white-space: normal; }
.wishes .lb > b { font-weight: 400; }
.wishes .lb i.who { color: var(--pw-ink); font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.wishes li small { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wishes li small > b { font: 400 17px var(--pw-game); color: var(--pw-ink); }
.wishes .by { display: flex; gap: 6px; }
.wishes .by span { display: inline-flex; align-items: center; gap: 3px; }
/* the open vote on our latest video, above the wishlist ("most-liked comment wins") */
.vote-card { margin: 0 0 14px; padding: 10px 10px 8px; border-radius: 14px; background: var(--pw-gold-light); border: 2px solid var(--pw-gold-dark); box-shadow: 0 2px 0 var(--pw-gold-dark); }
.vote-card .vh { margin: 0 4px 4px; font: 800 14px/1.35 var(--pw-body); color: var(--pw-ink); }
.vote-card .vh b { display: block; font: 400 19px var(--pw-game); color: var(--pw-red); }
.vote-card .list li { padding: 5px 4px; }
.vote-card .list li:hover { background: rgba(255, 255, 255, .45); }
.vote-card .go { display: block; margin: 4px 4px 0; text-align: right; font: 900 14px var(--pw-body); color: var(--pw-red); text-decoration: none; }

/* ---------- Daily Town: guess today's town from its houses ---------- */
.pw-btn.purple { --c: var(--pw-purple); --c2: var(--pw-purple-dark); --t: var(--pw-white); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
#dailyBtn { position: relative; }
#dailyBtn .dot { position: absolute; top: -7px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--pw-gold); border: 3px solid var(--pw-ink); animation: call 2.4s ease-in-out infinite; }
#dailyBtn .dot[hidden] { display: none; }
#dailyBtn .dot.streak { width: auto; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 4px; border-radius: 999px; background: var(--pw-parch); font: 400 12px/14px var(--pw-game); color: var(--pw-ink); text-shadow: none; animation: none; }
/* the map stays untouched under the puzzle, but out of reach (no zooming out to read the neighbours) and without a name on it */
#dailyShield { position: fixed; inset: 0; z-index: 4; touch-action: none; }
#dailyShield[hidden] { display: none; }
body.daily-on .place, body.daily-on .citylabel, body.daily-on .kingdom, body.daily-on .pin .tag { display: none !important; }
body.daily-on #search, body.daily-on #hud, body.daily-on #dock, body.daily-on #zoom, body.daily-on #evdock, body.daily-on #sampleBadge, body.daily-on #timectl, body.daily-on #credit { display: none; }
#daily { left: 16px; top: 82px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto; }
#daily .dhead { display: flex; align-items: center; gap: 10px; padding-right: 40px; margin-bottom: 4px; }
#daily .pw-ribbon { font-size: 20px; margin: 0 14px 0 18px; padding: 6px 16px 8px; }
#daily .pw-ribbon b { font-family: var(--pw-game); font-weight: 400; margin-left: 4px; }
#daily .pw-chip { height: 32px; font-size: 17px; padding: 0 10px 0 3px; gap: 6px; margin-left: auto; }
#daily .pw-chip > i { width: 24px; height: 24px; font-size: 13px; }
#daily .pw-chip[hidden] { display: none; }
#daily .dask { margin: 10px 0 8px; font: 400 19px/1.15 var(--pw-game); color: var(--pw-ink); }
#daily .dtries { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
#daily .dtries li {
  flex: 1 1 calc(50% - 6px); min-width: 0; box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 6px 8px 7px; border-radius: 10px; border: 2.5px solid var(--pw-ink);
  background: var(--pw-white); font: 400 14px/1.1 var(--pw-game); color: var(--pw-ink); box-shadow: inset 0 -3px 0 var(--pw-parch-edge), 0 2px 0 var(--pw-ink);
}
#daily .dtries li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#daily .dtries li.empty { background: rgba(255, 255, 255, .35); box-shadow: none; border-style: dashed; border-color: rgba(43, 29, 20, .35); color: rgba(43, 29, 20, .45); }
#daily .dtries li.x { background: #ffd3cc; box-shadow: inset 0 -3px 0 #e29487, 0 2px 0 var(--pw-ink); }
#daily .dtries li.c { background: #ffeaa3; box-shadow: inset 0 -3px 0 var(--pw-gold-dark), 0 2px 0 var(--pw-ink); }
#daily .dtries li.ok { background: #bfeab0; box-shadow: inset 0 -3px 0 var(--pw-green-dark), 0 2px 0 var(--pw-ink); }
#daily .dhints { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
#daily .dhints li { font: 800 14px/1.25 var(--pw-body); color: var(--pw-ink); padding-left: 24px; position: relative; animation: rise .26s ease-out; }
#daily .dhints li i { position: absolute; left: 0; top: 0; font-style: normal; }
#daily .dhints:empty { display: none; }
#daily .dhints li i.arrow { font: 400 22px/20px var(--pw-game); color: var(--pw-purple-dark); }
#daily .dhints .chips { display: inline-flex; gap: 4px; vertical-align: -4px; }
#daily .dhints .chips b { width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 2.5px solid var(--pw-ink); box-shadow: 0 1px 0 rgba(43, 29, 20, .35); }
#daily .dskip { display: block; min-height: 44px; margin: 0 auto -4px; padding: 8px 14px; border: 0; background: none; font: 800 14px var(--pw-body); color: var(--pw-ink-soft); text-decoration: underline; cursor: pointer; }
#daily .dskip[hidden] { display: none; }
/* the four answers: a 2x2 grid of big buttons (a thumb, a phone, Instagram's own browser: plain buttons, no hover, no search field) */
#daily .dopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 8px; }
#daily .dopt {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 64px; box-sizing: border-box; padding: 8px 10px 9px; margin: 0;
  border: 3px solid var(--pw-ink); border-radius: 16px; background: linear-gradient(180deg, #fff, var(--pw-parch)); box-shadow: 0 4px 0 var(--pw-ink);
  font: 800 16px/1.1 var(--pw-body); color: var(--pw-ink); text-align: left; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none;
}
#daily .dopt .fl { flex: none; font-size: 30px; line-height: 1; }
#daily .dopt .nm { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#daily .dopts[data-bonus] .dopt { justify-content: center; text-align: center; font-size: 17px; }
#daily .dopt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pw-ink); background: var(--pw-gold-light); }
#daily .dopt:focus-visible { outline: 3px solid var(--pw-gold); outline-offset: 2px; }
#daily .dopt:disabled { opacity: .42; transform: translateY(3px); box-shadow: 0 1px 0 var(--pw-ink); background: #e7dcc4; cursor: default; }
#daily .dopt:disabled .nm { text-decoration: line-through; }
@media (hover: hover) { #daily .dopt:not(:disabled):hover { background: var(--pw-gold-light); } }
#daily .ddone[hidden], #daily #dPlay[hidden] { display: none; }
#daily .dreveal { margin: 12px 0 8px; font: 400 24px/1.1 var(--pw-game); color: var(--pw-ink); }
#daily .dreveal small { display: block; margin-top: 4px; font: 800 15px var(--pw-body); color: var(--pw-ink-soft); }
#daily .dgrid { margin: 0 0 10px; padding: 10px 12px; background: #fff; border: 2.5px solid var(--pw-ink); border-radius: 12px; font: 800 16px/1.5 var(--pw-body); white-space: pre-wrap; color: var(--pw-ink); }
/* the result card's share: one big button, then the small ways (as text, to a friend) and the town */
#daily .dnudge { margin: 0 0 8px; font: 800 15px/1.3 var(--pw-body); color: var(--pw-ink); text-align: center; }
#daily .dnudge:empty { display: none; }
#daily .dshare { display: flex; width: 100%; box-sizing: border-box; font-size: 21px; padding: 14px 12px 15px; }
#daily .dshare i { font-style: normal; }
#daily .dshare:disabled { opacity: .75; cursor: progress; }
#daily .dshare.nudge { animation: dnudge 2.6s ease-in-out .8s infinite; }
@keyframes dnudge { 0%, 70%, 100% { transform: none; } 78% { transform: scale(1.04); } 86% { transform: scale(.98); } 93% { transform: scale(1.02); } }
/* the challenge: the banner on a challenge link, the head-to-head at the end, the name it is signed with, and the panel
   when there is no share sheet (Instagram's own browser, a laptop): WhatsApp, the link, Copy */
#daily .dvs { margin: 8px 0 2px; padding: 9px 12px 10px; border: 2.5px solid var(--pw-ink); border-radius: 12px; background: linear-gradient(180deg, #fff1b8, var(--pw-gold-light));
  box-shadow: 0 2px 0 var(--pw-ink); font: 400 17px/1.2 var(--pw-game); color: var(--pw-ink); animation: rise .26s ease-out; }
#daily .dvs::before { content: '⚔️ '; }
#daily .dvs.stale { background: #e3f1fb; font: 800 15px/1.3 var(--pw-body); }
#daily .dvs.stale::before { content: '📅 '; }
#daily .dvs[hidden], #daily .dh2h[hidden], #daily .dchfall[hidden] { display: none; }
#daily .dh2h { margin: 0 0 10px; padding: 10px 12px 11px; border: 2.5px solid var(--pw-ink); border-radius: 12px; box-shadow: 0 2px 0 var(--pw-ink); text-align: center;
  font: 400 20px/1.2 var(--pw-game); color: var(--pw-ink); background: #ffeaa3; }
#daily .dh2h.win { background: #bfeab0; }
#daily .dh2h.lose { background: #ffd3cc; }
#daily .dname { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 800 15px var(--pw-body); color: var(--pw-ink-soft); }
#daily .dname span { font: 800 16px var(--pw-body); color: var(--pw-ink); margin-left: 4px; }
#daily .dname input, #daily .dchfall input {
  flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 2.5px solid rgba(43, 29, 20, .35); border-radius: 12px;
  background: rgba(255, 255, 255, .75); font: 800 16px var(--pw-body); color: var(--pw-ink); outline: none;
}
#daily .dname input:focus, #daily .dchfall input:focus { box-shadow: 0 0 0 3px var(--pw-gold); }
#daily .dchfall { margin-top: 10px; padding: 10px; border: 2.5px dashed rgba(43, 29, 20, .35); border-radius: 14px; background: rgba(255, 255, 255, .45); animation: rise .26s ease-out; }
#daily .dchfall p { margin: 0 0 8px; font: 800 14px/1.3 var(--pw-body); color: var(--pw-ink); }
#daily .dchfall input { width: 100%; font-size: 14px; color: var(--pw-ink-soft); }
#daily .drow { display: flex; gap: 8px; margin-top: 8px; }
#daily .drow .pw-btn { flex: 1; min-height: 46px; box-sizing: border-box; justify-content: center; font-size: 17px; padding: 9px 10px 10px; text-decoration: none; }
#daily .dmore { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; }
#daily .dstory i { font-style: normal; text-decoration: none; }
#daily .dlink { min-height: 44px; padding: 6px 2px; border: 0; background: none; font: 800 15px var(--pw-body); color: var(--pw-blue-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#daily .dlink[hidden] { display: none; }
#daily .dfoot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
#daily .dfoot .dnext { flex: 1; margin: 0; text-align: left; }
#daily .dfoot .pw-btn { max-width: 52%; min-width: 0; min-height: 44px; box-sizing: border-box; font-size: 16px; padding: 9px 12px 10px; }
#daily .close::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; }   /* (a 44 px hit area round the 36 px ×) */
#daily .dfoot .pw-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dailyBtn .share { position: absolute; top: -10px; right: -8px; padding: 2px 6px 3px; border-radius: 999px; background: var(--pw-green); border: 2.5px solid var(--pw-ink);
  font: 400 11px/1 var(--pw-game); font-style: normal; color: var(--pw-white); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); box-shadow: 0 2px 0 var(--pw-ink); animation: call 2.4s ease-in-out infinite; }
#dailyBtn .share[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { #daily .dshare.nudge, #dailyBtn .share { animation: none; } }
#daily .dnext { margin: 10px 0 0; text-align: center; font: 800 14px var(--pw-body); color: var(--pw-ink-soft); }
@media (max-width: 760px) {
  #daily {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 58vh; overflow: auto;
    border-radius: 24px 24px 0 0; border-bottom: 0; padding: 18px 16px max(16px, env(safe-area-inset-bottom));
  }
  #daily:not([hidden]) { animation: sheet .3s cubic-bezier(.2, 1.1, .4, 1); }
  body.daily-on #logo { display: none; }
}

/* Call the Winner: who wins this week's Country Race? (call.js, app.js). A card on top of the Kingdoms list, a row on top of the events list, a sheet. */
.list li.callcard, .callrow {
  display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%; text-align: left; cursor: pointer; color: var(--pw-ink);
  background: linear-gradient(180deg, #fff1b8, var(--pw-gold-light)); border: 2.5px solid var(--pw-ink); box-shadow: 0 2px 0 var(--pw-ink);
}
.list li.callcard { margin: 0 0 8px; padding: 8px 10px; border-radius: 14px; min-height: 52px; }
.list li.callcard:hover { background: linear-gradient(180deg, #fff1b8, var(--pw-gold)); }
.list li.callcard[hidden], .callrow[hidden] { display: none; }
.callcard .cf, .callrow .cf { flex: none; font-size: 22px; line-height: 1; }
.callcard .ct, .callrow .ct { flex: 1; min-width: 0; }
.callcard .ct b, .callrow .ct b { display: block; font: 400 16px/1.1 var(--pw-game); }
.callcard .ct i, .callrow .ct i { display: block; margin-top: 2px; font: 800 12px/1.25 var(--pw-body); font-style: normal; color: var(--pw-ink-soft); }
.callcard em, .callrow em { flex: none; font: 400 15px/1 var(--pw-game); font-style: normal; padding: 7px 11px 8px; border-radius: 10px; color: var(--pw-white);
  background: var(--pw-red); border: 2.5px solid var(--pw-ink); box-shadow: inset 0 -3px 0 var(--pw-red-dark); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.callrow { margin: 0; padding: 6px 10px; border-width: 0 0 2.5px; border-radius: 0; box-shadow: none; min-height: 46px; font-family: inherit; }
.callrow .ct b { font-size: 15px; }
.callrow .ct i { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.callrow em { padding: 5px 10px 6px; font-size: 18px; }
.evdock.closed .callrow { border-bottom: 0; }
#call { left: 16px; top: 82px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto; }
#call .dhead { display: flex; align-items: center; gap: 10px; padding-right: 40px; margin-bottom: 4px; }
#call .pw-ribbon { font-size: 20px; margin: 0 14px 0 18px; padding: 6px 16px 8px; }
#call .pw-chip { height: 32px; font-size: 17px; padding: 0 10px 0 3px; gap: 6px; margin-left: auto; }
#call .pw-chip > i { width: 24px; height: 24px; font-size: 13px; }
#call .pw-chip[hidden] { display: none; }
#call .dask { margin: 10px 0 10px; font: 400 19px/1.15 var(--pw-game); color: var(--pw-ink); }
#call .kpick { display: flex; align-items: stretch; gap: 8px; margin: 0 0 12px; }
#call .kvs { align-self: center; font: 400 15px var(--pw-game); color: var(--pw-ink-soft); }
#call .kside {
  flex: 1; min-width: 0; min-height: 132px; padding: 12px 6px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--pw-ink); background: var(--pw-white); border: 3px solid var(--pw-ink); border-radius: 18px; box-shadow: inset 0 -5px 0 var(--pw-parch-edge), 0 3px 0 var(--pw-ink);
  transition: transform .08s, opacity .2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#call .kside:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--pw-parch-edge), 0 0 0 var(--pw-ink); }
#call .kside:disabled { cursor: default; }
#call .kside .kf { font-size: 46px; line-height: 1; }
#call .kside b { font: 400 21px/1.05 var(--pw-game); max-width: 100%; overflow-wrap: anywhere; text-align: center; }
#call .kside small { font: 800 13px var(--pw-body); color: var(--pw-ink-soft); }
#call .kside.mine { background: #ffeaa3; box-shadow: inset 0 -5px 0 var(--pw-gold-dark), 0 3px 0 var(--pw-ink); }
#call .kside.win { background: #bfeab0; box-shadow: inset 0 -5px 0 var(--pw-green-dark), 0 3px 0 var(--pw-ink); }
#call .kside.dim { opacity: .5; }
#call .ksplit { margin: 0 0 10px; }
#call .kbar { display: flex; height: 30px; overflow: hidden; border: 2.5px solid var(--pw-ink); border-radius: 999px; background: #fff; }
#call .kbar i { display: grid; place-items: center; min-width: 0; font: 400 15px/1 var(--pw-game); font-style: normal; color: var(--pw-white); text-shadow: 0 2px 0 rgba(0, 0, 0, .4); transition: width .5s ease-out; }
#call .kbar #kBarA { background: var(--pw-blue); box-shadow: inset 0 -4px 0 var(--pw-blue-dark); }
#call .kbar #kBarB { background: var(--pw-red); box-shadow: inset 0 -4px 0 var(--pw-red-dark); }
#call .ksplit p { margin: 6px 0 0; text-align: center; font: 800 15px var(--pw-body); color: var(--pw-ink); }
#call .kresult { margin: 0 0 8px; padding: 9px 12px; text-align: center; font: 400 21px/1.15 var(--pw-game); border: 2.5px solid var(--pw-ink); border-radius: 14px; background: #fff; color: var(--pw-ink); }
#call .kresult.won { background: #bfeab0; }
#call .kresult.lost { background: #ffd3cc; }
#call .kresult[hidden], #call .ksplit[hidden], #call .actions[hidden] { display: none; }
#call .actions { display: flex; gap: 10px; margin-top: 10px; }
#call .actions .pw-btn { flex: 1; min-width: 0; font-size: 17px; padding: 11px 8px 12px; }
#call .dnext { margin: 8px 0 0; text-align: center; font: 800 13px/1.35 var(--pw-body); color: var(--pw-ink-soft); }
@media (max-width: 760px) {
  #call { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 72vh; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 18px 16px max(16px, env(safe-area-inset-bottom)); }
  #call .kside { min-height: 120px; }
  .callrow { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { #call .kbar i, #call .kside { transition: none; } }

/* Fantasy game cards: existing parchment and gold, readable in a phone sheet. */
.gameboard { position:fixed; z-index:8; left:12px; bottom:var(--gameboard-bottom,90px); width:min(350px,calc(100vw - 24px)); max-height:48vh; overflow:auto; padding:10px 14px; border:2px solid #b88739; border-radius:12px; color:#302116; background:linear-gradient(110deg,#fff2d2,#ecd2a0); box-shadow:0 4px 18px #0004; font:700 13px Nunito,sans-serif; }
.gameboard[hidden], body.sheet-open .gameboard, body.evdock-open .gameboard { display:none; }
.gameboard summary { cursor:pointer; font-size:16px; }
.gameboard article { padding:12px 0; border-top:1px dashed #9e733e; }
.gameboard article b { font-size:18px; }
.gameboard p { line-height:1.5; overflow-wrap:anywhere; }
.game-score { font-variant-numeric:tabular-nums; }
.gameboard button { min-height:44px; white-space:normal; }
@media (prefers-reduced-motion:reduce) { .gameboard * { animation:none; transition:none; } }

/* Permanent sponsor chip */
#sponsor {
  position: fixed; z-index: 5; right: max(16px, env(safe-area-inset-right)); top: calc(max(14px, env(safe-area-inset-top)) + 64px);
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; max-width: 230px;
  color: var(--pw-ink); text-decoration: none; background: #f6e7c1; border: 3px solid var(--pw-ink); border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), var(--pw-lift);
}
#sponsor img { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--pw-ink); flex: none; }
#sponsor span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#sponsor small { font: 700 10px/1 'Nunito', sans-serif; letter-spacing: .6px; text-transform: uppercase; opacity: .65; }
#sponsor b { font: 400 19px/1.1 var(--pw-game); }
#sponsor em { font: 700 11px/1.1 'Nunito', sans-serif; font-style: normal; white-space: nowrap; }
#sponsor:hover { transform: translateY(-2px); }
@media (max-width: 1159px) { #sponsor { padding: 4px; border-radius: 14px; } #sponsor span { display: none; } #sponsor img { width: 38px; height: 38px; } }
@media (max-width: 760px) {
  /* Reserve a slot beside search so the supporter stays in the top row. */
  #search { right: calc(max(12px, env(safe-area-inset-right)) + 62px); }
  #credit { right: 88px; }
  #sponsor { right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); bottom: auto; }
}
body.system-view #sponsor { display: none; }

/* the weekly Tournament (board tab) */
.tourney .list { margin: 0 0 6px; padding: 0; }
.tourney-how { font: 700 13px/1.4 var(--pw-body); color: var(--pw-ink-soft); margin: -4px 0 12px; }
.tourney-head { font: 400 17px var(--pw-game); margin: 14px 0 4px; color: var(--pw-ink); }
.champ { display: grid; gap: 2px; padding: 10px 12px; margin: 0 0 6px; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--pw-gold-light), var(--pw-gold)); box-shadow: inset 0 -3px 0 var(--pw-gold-dark), 0 2px 0 var(--pw-ink); }
.champ small { font: 800 12px var(--pw-body); text-transform: uppercase; letter-spacing: .04em; color: var(--pw-ink-soft); }
.champ b { font: 400 22px var(--pw-game); color: var(--pw-ink); overflow-wrap: anywhere; }
.champ i { font: 700 13px var(--pw-body); font-style: normal; color: var(--pw-ink); }
.tourney-chip { cursor: pointer; border: 0; font: inherit; pointer-events: auto; }   /* (#hud lets taps through to the map; this one is a button) */
.tourney-chip small { white-space: nowrap; }
#hud .tourney-chip[hidden] { display: none; }   /* .pw-chip's display would show it otherwise */
@media (max-width: 760px) {   /* phones: no room in the top row, so the chip sits under it, on the right */
  #hud .tourney-chip { position: absolute; top: 100%; right: 0; margin-top: 8px; }
  #hud .tourney-chip small { display: inline; font-size: 12px; margin-left: 2px; }
}
