/* 👋 Welcome back (js/welcome-back.js), in the start screen's look like the profile window and the Almanac: the window in the
   lobby's dusk with a thin gold edge; the head is the start screen's town with their own hero standing in it, the name in
   gold, the three numbers on dark glass and a bar a day for the updates; then the biggest updates (the first large with its
   picture, five rows beside it), "Also new", and the gold Let's go. Everything comes in once (.go) unless motion is off. */
.modal:has(> #modalBody > .wbk-win) { border: 1px solid rgba(232, 196, 106, 0.42); border-radius: 6px; background: linear-gradient(180deg, #19163a, #0c0b20); box-shadow: 0 0 0 1px #05040f, 0 14px 34px rgba(0, 0, 0, 0.55); }
.wbk-win {
  --tan: #e8c46a; --line: rgba(232, 196, 106, 0.34); --hair: rgba(232, 196, 106, 0.16); --soft: #b9bfdc; --mute: #9ea6cc;
  --glass: linear-gradient(180deg, rgba(14, 18, 50, 0.92), rgba(7, 10, 30, 0.92));
  position: relative; display: grid; gap: 10px; min-width: 0;
}
.wbk-win > *, .wbk-win p, .wbk-win h2, .wbk-win h3, .wbk-win ol, .wbk-win ul { margin: 0; }
.wbk-win button { font: inherit; color: inherit; }

/* The head: the start screen's town, their hero on its terrace, their name and the numbers on the dusk's plate. */
.wbk-top { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; grid-template-areas: "stage id nums" "stage days days"; align-items: center; gap: 8px 14px; box-sizing: border-box; min-height: 184px; padding: 14px 46px 10px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #2a2142 url("/world/assets/start/town-1280.webp") 50% 100% / cover no-repeat; }
.wbk-top::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5, 8, 28, 0.05), rgba(5, 8, 28, 0.62) 26%, rgba(5, 8, 28, 0.8)), linear-gradient(0deg, rgba(5, 8, 28, 0.55), transparent 50%); }
.wbk-top > * { position: relative; }
.wbk-sky { position: absolute; inset: 0; pointer-events: none; }
.wbk-sky i { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 6px 2px rgba(255, 210, 63, 0.7); opacity: 0; }
.wbk-stage { grid-area: stage; align-self: stretch; min-height: 150px; }
.wbk-hero { position: absolute; left: 50%; bottom: 8px; width: 64px; height: 128px; translate: -50% 0; object-fit: contain; object-position: 50% 100%; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.wbk-shadow { position: absolute; left: 50%; bottom: 8px; width: 62px; height: 16px; translate: -50% 50%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent); }
.wbk-id { grid-area: id; display: grid; justify-items: start; gap: 4px; min-width: 0; }
.modal .wbk-kick { color: var(--tan); font: 400 12px/1 var(--display); letter-spacing: 0.32em; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.wbk-id h2 { max-width: 100%; padding-bottom: 2px; overflow-wrap: anywhere; font: 400 40px/1.05 var(--display); letter-spacing: 0.01em; color: transparent; background: linear-gradient(180deg, #fff6c8, #ffd23f 52%, #dc9a1c); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 rgba(40, 20, 0, 0.75)); }
.modal .wbk-say { font-size: 19px; line-height: 1.25; color: #f1ecd8; text-shadow: 0 1px 2px #000; }
.wbk-say b { color: var(--gold); font-weight: 400; font-family: var(--display); letter-spacing: 0.02em; }

/* The numbers: big white figures (the updates in gold) over small gold capitals, on dark glass. */
.wbk-nums { grid-area: nums; display: grid; grid-template-columns: repeat(3, minmax(92px, auto)); gap: 6px; align-self: center; }
.wbk-num { display: grid; justify-items: center; gap: 5px; padding: 9px 10px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--glass); text-align: center; }
.wbk-num b { font: 400 30px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.wbk-num.gold b { color: var(--gold); text-shadow: 0 0 14px rgba(255, 210, 63, 0.35); }
.wbk-num small { color: var(--tan); font: 400 10px/1.15 var(--display); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }

/* A bar a day: blue, the busiest gold, sunk into the plate. */
.wbk-days { grid-area: days; display: grid; gap: 3px; min-width: 0; }
.wbk-bars { display: flex; align-items: flex-end; gap: 2px; height: 30px; padding: 4px 6px 0; border: 1px solid var(--hair); border-radius: 3px; background: rgba(5, 8, 28, 0.55); }
.wbk-bars i { flex: 1 1 0; min-width: 1px; height: var(--h); border-radius: 1px 1px 0 0; background: linear-gradient(180deg, #8eaaff, #5a7ce8); transform-origin: 50% 100%; }
.wbk-bars i.big { background: linear-gradient(180deg, #fff0a8, #ffc21a); box-shadow: 0 0 8px rgba(255, 210, 63, 0.5); }
.wbk-ax { display: flex; justify-content: space-between; gap: 8px; color: var(--mute); font-size: 13px; line-height: 1; text-shadow: 0 1px 2px #000; }
.wbk-ax span:nth-child(2) { color: var(--tan); font: 400 10px/1.3 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }

/* A panel: dark glass, a thin gold edge, its name in small gold capitals over a hairline, a note on its right. */
.wbk-card { display: grid; gap: 8px; min-width: 0; padding: 0 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--glass); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 240, 200, 0.06); }
.wbk-card > h3 { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 9px 12px 8px; border-bottom: 1px solid var(--hair); color: var(--tan); font: 400 12px/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }
.wbk-card > h3 small { margin-left: auto; padding-left: 8px; color: var(--soft); font: 400 15px/1 var(--ui-font); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.wbk-card > :not(h3) { margin-left: 12px; margin-right: 12px; }

/* The biggest: the first large with its picture, the next five as rows beside it. */
.wbk-best { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 10px; align-items: start; }
.wbk-lead { display: grid; align-content: start; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: rgba(6, 10, 32, 0.62); text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.wbk-lead:hover, .wbk-lead:focus-visible { border-color: var(--tan); transform: translateY(-2px); outline: none; }
/* The picture's own box sets the height (an aspect-ratio on the span inside the button didn't take). */
.wbk-pic { position: relative; display: block; width: 100%; overflow: hidden; background: #0b0d22; }
.wbk-pic img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.wbk-pic::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 246, 200, 0.38) 50%, transparent 65%); transform: translateX(-120%); }
.wbk-pic time { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px 2px; border: 1px solid var(--line); border-radius: 999px; background: rgba(6, 10, 32, 0.82); color: #f1ecd8; font-size: 14px; line-height: 1.2; }
.wbk-lead .wbk-txt { display: grid; gap: 5px; padding: 10px 12px 12px; }
.wbk-area { color: var(--tan); font: 400 11px/1.25 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.wbk-lead .wbk-txt b { font: 400 22px/1.18 var(--display); letter-spacing: 0.01em; color: #fff; }
.wbk-rows { display: grid; gap: 5px; padding: 0; list-style: none; }
.wbk-rows button { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; grid-template-areas: "thumb txt time"; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 4px 10px 4px 4px; border: 1px solid var(--hair); border-radius: 4px; background: rgba(6, 10, 32, 0.55); text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.wbk-rows button:hover, .wbk-rows button:focus-visible { border-color: var(--tan); background: rgba(232, 196, 106, 0.08); outline: none; }
.wbk-thumb { grid-area: thumb; display: block; width: 80px; height: 60px; overflow: hidden; border-radius: 3px; background: #0b0d22; }
.wbk-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wbk-rows .wbk-txt { grid-area: txt; display: grid; gap: 3px; min-width: 0; }
.wbk-rows .wbk-txt b { font-weight: 400; font-size: 17px; line-height: 1.2; color: #f1ecd8; }
.wbk-rows time { grid-area: time; align-self: start; padding-top: 4px; color: var(--mute); font-size: 14px; line-height: 1; white-space: nowrap; }

/* Also new: short lines in two columns, a gold dot each. */
.wbk-also ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; padding: 0; list-style: none; }
.wbk-also button { position: relative; display: block; width: 100%; padding: 3px 0 3px 16px; border: 0; background: none; text-align: left; font-size: 16px; line-height: 1.25; color: #dfe3f7; cursor: pointer; }
.wbk-also button::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(255, 210, 63, 0.6); }
.wbk-also button b { color: var(--tan); font-weight: 400; }
.wbk-also button:hover, .wbk-also button:focus-visible { color: #fff; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; outline: none; }

/* Let's go stays in view when the window scrolls (.modal scrolls; -18px covers its bottom padding). */
.wbk-acts { position: sticky; bottom: -18px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -22px -18px; padding: 10px 22px 16px; background: linear-gradient(180deg, rgba(12, 11, 32, 0), #0c0b20 14px); }
.wbk-go { box-sizing: border-box; height: 42px; padding: 0 26px; border: 1px solid #8a6410; border-radius: 3px; background: linear-gradient(180deg, #ffe27a, #ffc21a); color: #1d1404 !important; font: 400 16px/1 var(--display) !important; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 1px #05040f, 0 4px 12px rgba(255, 194, 26, 0.25); }
.wbk-go:hover, .wbk-go:focus-visible { background: linear-gradient(180deg, #fff0a8, #ffd23f); outline: none; }

/* Coming in (.go): the hero hops in, the numbers count (JS), the bars rise a day at a time, the big card pops with a shine
   over its picture, the rows slide in, the sparks twinkle, and Let's go breathes once everything is in. */
.wbk-win.go .wbk-hero { animation: wbk-hop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) 0.1s both, wbk-bob 2.4s ease-in-out 1s infinite; }
.wbk-win.go .wbk-id { animation: wbk-up 0.5s ease-out both; }
.wbk-win.go .wbk-num { animation: wbk-up 0.5s ease-out both; }
.wbk-win.go .wbk-num:nth-child(2) { animation-delay: 0.08s; }
.wbk-win.go .wbk-num:nth-child(3) { animation-delay: 0.16s; }
.wbk-win.go .wbk-bars i { animation: wbk-rise 0.45s ease-out calc(0.2s + min(var(--i), 90) * 12ms) both; }
.wbk-win.go .wbk-sky i { animation: wbk-twinkle 3.2s ease-in-out var(--d) infinite; }
.wbk-win.go .wbk-lead { animation: wbk-pop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) 0.3s both; }
.wbk-win.go .wbk-pic::after { animation: wbk-shine 1.1s ease-in-out 0.9s both; }
.wbk-win.go .wbk-pic img { animation: wbk-drift 14s ease-in-out 0.8s infinite alternate; }
.wbk-win.go .wbk-rows li { animation: wbk-slide 0.45s ease-out calc(0.45s + var(--i) * 0.12s) both; }
.wbk-win.go .wbk-also { animation: wbk-up 0.5s ease-out 1.05s both; }
.wbk-win.go .wbk-go { animation: wbk-up 0.4s ease-out 1.1s both, wbk-glow 2.2s ease-in-out 1.6s infinite; }
@keyframes wbk-hop { from { opacity: 0; transform: translateY(-46px); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes wbk-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
@keyframes wbk-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wbk-rise { from { transform: scaleY(0); } to { transform: none; } }
@keyframes wbk-twinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 0.9; transform: scale(var(--s)); } }
@keyframes wbk-pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes wbk-shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes wbk-drift { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes wbk-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes wbk-glow { 0%, 100% { box-shadow: 0 0 0 1px #05040f, 0 4px 12px rgba(255, 194, 26, 0.25); } 50% { box-shadow: 0 0 0 1px #05040f, 0 0 22px rgba(255, 210, 63, 0.6); } }
@media (prefers-reduced-motion: reduce) { .wbk-win *, .wbk-win *::before, .wbk-win *::after { animation: none !important; transition: none !important; } }

/* Narrower windows: the numbers go under the name, then the big card goes above the rows. */
@media (max-width: 860px) {
  .wbk-top { grid-template-columns: 120px minmax(0, 1fr); grid-template-areas: "stage id" "stage nums" "days days"; padding-left: 0; }
  .wbk-nums { justify-self: start; }
}
@media (max-width: 600px) {
  .wbk-top { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "stage id" "nums nums" "days days"; min-height: 0; gap: 8px 8px; padding: 12px 40px 10px 0; }
  .wbk-top > .wbk-nums, .wbk-top > .wbk-days { margin-left: 10px; margin-right: -30px; }
  .wbk-stage { min-height: 104px; }
  .wbk-hero { width: 48px; height: 96px; bottom: 6px; }
  .wbk-shadow { width: 46px; bottom: 6px; }
  .wbk-id h2 { font-size: 30px; }
  .modal .wbk-say { font-size: 16px; }
  .wbk-nums { justify-self: stretch; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wbk-num { padding: 7px 4px 6px; }
  .wbk-num b { font-size: 24px; }
  .wbk-num small { font-size: 9px; letter-spacing: 0.08em; white-space: normal; } /* "Parts of the game" takes two lines here */
  .wbk-card > h3 small { display: none; }
  .wbk-best { grid-template-columns: minmax(0, 1fr); }
  .wbk-pic img { aspect-ratio: 16 / 10; }
  .wbk-lead .wbk-txt b { font-size: 20px; }
  .wbk-rows button { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "thumb txt" "thumb time"; gap: 2px 10px; }
  .wbk-thumb { width: 76px; height: 57px; }
  .wbk-rows .wbk-txt b { font-size: 16px; }
  .wbk-rows time { padding-top: 0; font-size: 13px; }
  .wbk-also ul { grid-template-columns: minmax(0, 1fr); }
  .wbk-acts { flex-wrap: nowrap; padding-top: 8px; padding-bottom: 12px; }
  .wbk-acts .hp-act { flex: none; height: 42px; }
  .wbk-long { display: none; } /* "📰 Dev log" beside Let's go */
  .wbk-go { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
}
