.store-art {
  display:inline-block; width:1.45em; height:1.45em; flex:none; vertical-align:middle;
  background:url("./assets/stores-atlas.webp") 0 0 / 300% 200% no-repeat;
}
.store-wood {background-position:50% 0}
.store-stone {background-position:100% 0}
.store-iron {background-position:0 100%}
.store-diamonds {background-position:50% 100%}
.store-shield {background-position:100% 100%}
.resource-inline .store-art {width:1.5em;height:1.5em}
.train-costs .store-art {margin-right:4px}

/* The login view shares one landscape between the title and the sign-in panel. */
.gate {
  position:relative; isolation:isolate; display:flex; flex-direction:column;
  min-height:100svh; background:#182d27; color:#fff4d9;
}
.gate::before {
  content:""; position:absolute; pointer-events:none; z-index:-1; inset:0 min(18vw,320px) 0 0;
  background:linear-gradient(90deg,transparent 53%,#182d27 100%),
    linear-gradient(0deg,#11281ff2 0%,#162b2080 24%,transparent 58%,#1c2b2233),
    url("./assets/estate.webp") 61% 40% / cover no-repeat;
}
.gate-top {
  display:flex; align-items:center; justify-content:space-between; min-height:76px; padding:12px clamp(20px,5vw,96px);
  border-bottom:1px solid #dfc8805c; background:#152c25cf;
}
.gate-top .brand strong {font-size:1.65rem;letter-spacing:.09em}
.gate-top .brand span {font-size:.64rem;letter-spacing:.36em}
.top-help {
  display:inline-flex; gap:7px; align-items:center; min-height:42px; padding:7px 13px;
  color:#f9eed6; background:#162b2480; border:1px solid #c7b68570; border-radius:4px; font-size:.85rem;
}
.top-help:hover {background:#314334}
.gate-layout {
  flex:1; width:min(100%,1940px); margin:auto; display:grid; align-items:center;
  grid-template-columns:minmax(0,1fr) minmax(320px,420px); gap:clamp(30px,6vw,120px);
  padding:clamp(34px,6.5vh,96px) clamp(32px,6.5vw,128px);
}
.cover {align-self:stretch; display:flex; align-items:flex-end; padding:0 0 clamp(12px,4vh,68px)}
.cover-wrap {text-shadow:0 2px 15px #10271eab}
.campaign-line {display:flex;align-items:center;gap:9px;color:#ffedc6;font-weight:650;font-size:.9rem;letter-spacing:.015em}
.campaign-line::before {content:""; width:36px; border-top:1px solid #deb977}
.campaign-line .icon {width:1em;height:1em}
.cover h1 {margin:8px 0 0; font:600 clamp(3.3rem,5.8vw,7rem)/1.27 var(--serif); letter-spacing:-.075em; word-break:keep-all; color:#fff7df}
.gate-form {
  color:var(--ink); position:relative; padding:clamp(27px,3.1vw,52px);
  border:1px solid #bca475; border-radius:6px;
  background:linear-gradient(130deg,#fffcf2,#f2ead7);
  box-shadow:inset 0 0 0 4px #fcf7eb,inset 0 0 0 5px #ccbc9a,0 24px 64px #0b1c1766;
}
.gate-form-title {display:flex;align-items:center;justify-content:space-between;gap:12px}
.gate-form-title h2 {font:700 clamp(1.75rem,2.3vw,2.45rem)/1.35 var(--serif);letter-spacing:-.065em}
.gate-form-title .store-shield {width:43px;height:43px}
.auth-tabs {display:flex;gap:14px;border-bottom:1px solid #cfc2a4;margin:20px 0 24px}
.auth-tabs button {border-bottom:2px solid transparent;color:#57645b;font-size:.9rem;font-weight:650;padding:9px 5px;min-height:44px}
.auth-tabs button[aria-pressed=true] {color:var(--forest);border-bottom-color:#83652f}
#auth-form input {border:1px solid #b9b7a4;border-radius:3px;background:#fffdf8;min-height:47px}
#auth-form label {color:#344738}
#auth-form label:not(:first-child) {margin-top:17px}
#auth-submit {margin-top:12px;min-height:48px;justify-content:space-between;padding-inline:17px}
#auth-error:empty {margin:0}

/* The command frame retains its footprint while both map cameras move. */
.game-shell .hud {
  background:linear-gradient(100deg,#182f29,#263e32 52%,#162d26);color:#f9f3e4;
  border-bottom:1px solid #9b8051;
}
.game-shell .primary,.gate .primary,.game-shell .action-btn,#action-dialog .primary {
  background-color:var(--forest); color:#fffcf0; border:1px solid #294b3a;
  box-shadow:inset 0 1px #ffffff21,0 1px 1px #13261b12;
}
.game-shell .primary:hover:enabled,.gate .primary:hover:enabled,.game-shell .action-btn:hover:enabled,#action-dialog .primary:hover:enabled {background-color:#315840}
.game-shell input,.game-shell select,dialog input,dialog select {border-color:#bbb8a7}
.game-shell :focus-visible,.gate :focus-visible,dialog :focus-visible {outline:3px solid #ab6a18;outline-offset:2px}
.game-shell .page-heading {
  align-items:center; position:relative; padding:4px 0 clamp(13px,1.3vw,22px);
  border-bottom:1px solid #b9a982; margin-bottom:12px;
}
.page-title {display:flex;align-items:center;gap:clamp(13px,1.6vw,24px);min-width:0}
.page-sigil {
  flex:none;display:grid;place-items:center;color:#eed59b;background:#25463a;
  width:clamp(44px,4.3vw,66px);height:clamp(50px,4.7vw,72px);
  clip-path:polygon(0 0,100% 0,100% 78%,50% 100%,0 78%);
  border-top:3px solid #ab8d54;padding-bottom:5px;
}
.page-sigil .icon {width:52%;height:52%;stroke-width:1.5}
.page-title .breadcrumb {font-size:.78rem;line-height:1.4;letter-spacing:.02em;color:#5d6758}
.page-title .breadcrumb span {color:#968055;padding:0 1px}
.game-shell .page-heading h1 {margin:3px 0 0;font-size:clamp(1.8rem,2.55vw,2.85rem);line-height:1.22;letter-spacing:-.065em}
.page-heading .day {color:#3e493c;font-variant-numeric:tabular-nums}
.game-shell:not(.scene-open) .play-area {background:linear-gradient(135deg,#ece8db 0,transparent 460px),var(--paper)}
.game-shell:not(.scene-open) main>.command-strip {padding:0;gap:5px 14px;background:transparent;border:0;justify-content:space-between;border-bottom:1px solid var(--line)}
.game-shell:not(.scene-open) main>.command-strip button {text-align:left;min-height:42px;padding:3px 2px}
.game-shell:not(.scene-open) main>.command-strip button:hover {background:#ebe7d9}
.game-shell:not(.scene-open) main>.command-strip .goal-link small {color:#765d30}
.game-shell:not(.scene-open) .operation-cards .work-card {border-left:1px solid var(--line);padding-left:10px}
.game-shell .more-sheet:not([hidden]) {background:#faf5e8;border-color:#ab9264}
.game-shell .more-sheet > div {gap:6px}
.game-shell .more-sheet > div button {background:var(--panel);border-color:#d4c8af;border-radius:3px;min-height:48px}
.game-shell .more-sheet > div button .icon {color:#7d724b}
.game-shell .more-sheet > div button:hover,.game-shell .more-sheet > div button[aria-current=page] {background:#e7eddf;border-color:#809078}
.entry-connection {
  justify-items:start; padding:clamp(20px,7vw,120px);
  background:linear-gradient(90deg,#102820d9 0%,#132b246b 50%,#132b2414),url("./assets/estate.webp") center / cover,#192f28;
}
.connection-card {
  width:min(100%,26rem); color:#233d31; text-align:start;
  background:#f6f1e4; border:1px solid #d6c49d; border-top:3px solid #bd9a58;
  padding:clamp(23px,3.6vw,45px); border-radius:4px; box-shadow:0 12px 40px #13231d47;
}
.connection-card .brand {width:fit-content;color:#284334;margin:0 0 22px}
.connection-card .brand span {color:#70552b}
.connection-card h1 {font:700 clamp(1.35rem,2.8vw,1.85rem)/1.38 var(--serif);letter-spacing:-.055em;word-break:keep-all}
.connection-card p {color:#4e594f;margin-top:10px;font-size:.94rem}
.connection-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.connection-actions button {min-height:44px;padding:6px 15px}
.connection-track {display:block;position:relative;overflow:hidden;height:3px;background:#d7cfb8;margin-top:21px}
.connection-track::before {content:"";display:block;width:35%;height:100%;background:#84703f}
@media(prefers-reduced-motion:no-preference) {
  .connection-track::before {animation:connection-wait 2.1s ease-in-out infinite alternate}
  @keyframes connection-wait {to{transform:translateX(184%)}}
}
@media(max-width:760px) {
  .entry-connection {justify-items:center;align-content:end;padding-bottom:max(9dvh,env(safe-area-inset-bottom));background-position:57% center}
}
#notice {
  text-align:start;color:#faf3df;background:#213c30;
  border:1px solid #9c8a5e;border-inline-start:3px solid #d9b76e;padding:10px 14px 11px 10px;
  box-shadow:0 4px 18px #16261c4a;line-height:1.4;
}
.receipt-message {display:flex;align-items:flex-start;gap:10px}
.receipt-close {visibility:hidden;position:absolute;top:0;right:0;width:44px;height:44px;pointer-events:auto;color:#e4ddc6;font:1.35rem/1 var(--sans)}
#notice.visible .receipt-close {visibility:visible}
.receipt-close:hover,.receipt-close:focus-visible {color:#fff;background:#304d3f;outline-offset:-3px}
.receipt-symbol {width:30px;height:30px;display:grid;place-items:center;flex:none;color:#eed799;background:#314d3c;border-radius:50%}
.receipt-symbol .icon {width:19px;height:19px}
.receipt-copy {min-width:0;align-self:center}
.receipt-copy>strong {display:block;padding-inline-end:36px;font-size:.95rem;overflow-wrap:anywhere}
.receipt-time,.receipt-reward {display:flex;align-items:center;flex-wrap:wrap;gap:5px;color:#ecdfbd;margin-top:4px;font-size:.84rem}
.receipt-time .icon {width:1rem;height:1rem}
.receipt-reward b,.receipt-time time,.harvest-receipt td {font-variant-numeric:tabular-nums}
.receipt-reward b {color:#fff5d8}
.harvest-receipt {border-collapse:collapse;margin-top:5px;font-size:.8rem;color:#e5ebdc;text-align:end}
.harvest-receipt td,.harvest-receipt th {padding:3px 4px;line-height:1.35}
.harvest-receipt thead th {color:#f1dfa8;border-bottom:1px solid #667658;font-weight:600}
.harvest-receipt .store-art {width:1rem;height:1rem}
.harvest-receipt tbody th {padding-inline-start:0;text-align:start;font-weight:500}
.harvest-receipt tbody tr:first-child td {font-weight:700;color:#fff6df}
@media(max-width:400px) {
  #notice {padding-inline:7px;max-width:calc(100% - 12px)}
  .receipt-message {gap:6px}
  .harvest-receipt td,.harvest-receipt th {padding-inline:2px}
}
dialog::backdrop {background:#11231dd6}

@media(min-width:761px) {
  .game-shell .hud {gap:clamp(7px,1.2vw,22px);box-shadow:0 2px 9px #162b2138}
  .hud-brand {padding-right:clamp(9px,1.7vw,32px);border-color:#d4b47963}
  .hud .resources {gap:3px;justify-content:space-evenly}
  .hud .stock {flex:1 1 0;gap:clamp(5px,.65vw,12px);position:relative}
  .hud .stock+.stock::before {content:"";position:absolute;left:0;height:20px;border-left:1px solid #e0ca8f29}
  .hud .stock .store-art {width:clamp(27px,2.65vw,45px);height:clamp(27px,2.65vw,45px)}
  .hud .stock>span {display:grid;gap:2px;line-height:1.15;text-align:left}
  .hud .stock small {color:#d9dfcf;font:550 .74rem/1.1 var(--sans)}
  .hud .stock b {color:#fff4d6;font:650 clamp(.99rem,1.2vw,1.43rem)/1.1 Georgia,var(--sans);font-variant-numeric:tabular-nums}
  .hud .shield-status {border:1px solid #9c8e60;border-radius:4px;background:#203a2e;gap:6px;padding:2px 11px}
  .hud .shield-status::before {display:none}
  .hud .shield-status .store-art {width:28px;height:28px}
  .game-shell .rail {background:linear-gradient(90deg,#20392f,#1b322a 78%,#142c24);border-right:1px solid #746b4b}
  .game-shell .rail-nav {gap:6px}
  .game-shell .rail-nav button {border-radius:4px}
  .game-shell .rail-nav button[aria-current=page] {background:linear-gradient(115deg,#395742,#2a4537);border-color:#a78c58;box-shadow:inset 0 1px #eedba522,0 2px 4px #17291f32}
  .game-shell .rail-nav button[aria-current=page]::before {display:block;inset:22% auto 22% -1px;width:3px;background:#e4c58b;border-radius:0 2px 2px 0}
  .game-shell .rail-toggle {border-top:1px solid #bfad7855;border-radius:0}
  .game-shell .rail-nav button .icon {stroke-width:1.5}
}
@media(min-width:761px) and (max-width:940px) {
  .hud-brand .brand {gap:5px}
  .hud .stock .store-art {width:24px;height:24px}
  .game-shell .hud {padding-inline:8px;gap:5px}
  .hud .shield-status {padding-inline:5px}
}
@media(max-width:760px) {
  .gate {--cover-height:clamp(225px,37svh,395px);min-height:100svh;background:var(--paper)}
  .gate:has([data-auth-tab="login"][aria-pressed="true"]) {--cover-height:clamp(245px,48svh,460px)}
  .gate::before {inset:0 0 auto;height:var(--cover-height);background:linear-gradient(0deg,#142b22e0,transparent 63%),url("./assets/estate.webp") 60% 44% / cover no-repeat}
  .gate-top {min-height:54px;padding:7px 18px;background:#172e25cf}
  .gate-top .crest {width:32px;height:32px}
  .gate-top .brand {gap:6px}
  .gate-top .brand strong {font-size:1.22rem}
  .gate-top .brand span {font-size:.51rem}
  .top-help {min-height:36px;padding:4px 9px;font-size:.78rem}
  .gate-layout {display:flex;flex:1;flex-direction:column;align-items:stretch;gap:0;padding:0 0 22px}
  .cover {height:calc(var(--cover-height) - 54px);flex:none;padding:0 max(22px,calc((100% - 460px)/2)) 26px}
  .campaign-line {font-size:.76rem;gap:6px}
  .campaign-line::before {width:22px}
  .cover h1 {font-size:clamp(2.65rem,9vw,3.9rem);margin-top:3px}
  .gate-form {margin:-8px auto 0;width:min(calc(100% - 26px),500px);padding:22px clamp(18px,5.6vw,35px) 24px;box-shadow:inset 0 3px #c4a469,0 4px 14px #1e2f1b13}
  .gate-form-title .store-art {width:35px;height:35px}
  .gate-form-title h2 {font-size:1.65rem}
  .auth-tabs {margin:9px 0 16px}
  .auth-tabs button {min-height:43px}
  #auth-form input {min-height:45px}
  .game-shell .hud {padding-inline:max(5px,env(safe-area-inset-left)) max(5px,env(safe-area-inset-right));gap:3px}
  .game-shell .hud .resources {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px}
  .hud .stock {display:flex;justify-content:center;align-items:center;gap:2px}
  .hud .stock .store-art {width:clamp(18px,5.5vw,29px);height:clamp(18px,5.5vw,29px)}
  .hud .stock small {color:#d4d9c8;font-size:.69rem}
  .hud .stock b {color:#fff3d4;font-size:clamp(.74rem,2.9vw,.95rem);font-variant-numeric:tabular-nums;line-height:1.23}
  .hud .shield-status .store-art {width:22px;height:22px}
  .game-shell .page-heading {padding:2px 0 11px;margin-bottom:4px}
  .page-title {gap:9px}
  .page-sigil {width:34px;height:41px;border-top-width:2px}
  .game-shell .page-heading h1 {font-size:clamp(1.5rem,5.75vw,2rem);margin-top:1px}
  .page-title .breadcrumb {font-size:.69rem}
  .game-shell .bottom-nav {background:linear-gradient(0deg,#192e26,#243d32);border-color:#8b794f}
  .bottom-nav button[aria-current=page] {background:#33503e;color:#f5dca4}
  .bottom-nav button[aria-current=page]::after {top:-2px;width:60%;background:#dbc08a}
  .game-shell:not(.scene-open) main>.command-strip {gap:4px}
  .game-shell:not(.scene-open) main>.command-strip .goal-link {justify-content:flex-start;font-size:.8rem}
}
@media(min-width:761px) and (max-width:1000px) and (orientation:portrait) {
  .gate::before {inset:0;background:linear-gradient(0deg,#172d26 0%,#172d268c 35%,transparent 70%),url("./assets/estate.webp") 64% 30% / cover}
  .gate-layout {grid-template-columns:minmax(0,1fr);align-content:end;gap:22px;width:min(100%,640px);padding:32px 36px clamp(38px,7vh,82px)}
  .cover {padding:0}
  .gate-form {padding:26px 34px}
}
@media(prefers-reduced-motion:no-preference) {
  .primary,.action-btn,.rail-nav button,.auth-tabs button {transition:background-color 130ms ease,border-color 130ms ease}
}
