:root {
  --ink: #182720;
  --ink-soft: #35463b;
  --ink-faint: #6b776d;
  --paper: #f3e8d1;
  --paper-warm: #ead9b8;
  --paper-deep: #d7bd8d;
  --paper-light: #fbf5e8;
  --vermilion: #9f3d2d;
  --vermilion-dark: #762b21;
  --vermillion-light: #bd5a43;
  --jade: #46685b;
  --gold: #a77b38;
  --line: rgba(62, 48, 29, .18);
  --line-strong: rgba(62, 48, 29, .34);
  --shadow: 0 18px 50px rgba(37, 27, 14, .16);
  --serif: "FangSong", "STFangsong", "Noto Serif SC", "Songti SC", serif;
  --kai: "KaiTi", "STKaiti", "FZKai-Z03", "Noto Serif SC", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --radius: 5px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #17251f;
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: #17251f;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #d5a65b;
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: .045;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 18% 27%, transparent 0, rgba(60, 40, 20, .5) 1px, transparent 2px, transparent 6px),
    repeating-linear-gradient(91deg, transparent 0, transparent 15px, rgba(94, 70, 42, .3) 16px, transparent 17px);
  background-size: 23px 19px, 37px 31px;
  mix-blend-mode: multiply;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #f9f0df;
  background: var(--vermilion);
  border-color: var(--vermilion);
  box-shadow: 0 8px 24px rgba(105, 40, 29, .18);
}

.button-primary:not(:disabled):hover {
  background: var(--vermilion-dark);
  border-color: var(--vermilion-dark);
  box-shadow: 0 10px 28px rgba(86, 31, 23, .28);
}

.button-primary:disabled {
  color: rgba(241, 233, 218, .6);
  background: #756754;
  border-color: #756754;
  box-shadow: none;
  cursor: not-allowed;
}

.button-outline {
  color: var(--ink-soft);
  background: rgba(255, 252, 243, .5);
  border-color: var(--line-strong);
}

.button-outline:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 252, 243, .8);
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.button-ghost:hover {
  background: rgba(70, 56, 35, .07);
}

.button-large {
  min-height: 58px;
  padding: 0 27px;
  font-size: 16px;
  letter-spacing: .16em;
}

.button-block {
  width: 100%;
}

.button-arrow {
  display: inline-block;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  transition: transform .2s ease;
}

.button:hover .button-arrow {
  transform: translateX(3px);
}

.text-button {
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: rgba(43, 59, 49, .3);
  text-underline-offset: 5px;
}

.text-button:hover {
  color: var(--vermilion);
  text-decoration-color: var(--vermilion);
}

.with-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 252, 244, .45);
  font-family: var(--kai);
  font-size: 17px;
  line-height: 1;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.icon-button:hover {
  background: var(--paper-light);
  border-color: var(--line-strong);
  transform: rotate(-3deg);
}

.section-kicker,
.eyebrow {
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* Title */

.title-screen {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  color: #f2e5cc;
  background:
    radial-gradient(circle at 72% 30%, rgba(172, 102, 56, .2), transparent 25%),
    linear-gradient(145deg, #14251f 0%, #1d3027 45%, #22342b 100%);
}

.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .3;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(219, 196, 155, .05) 80px),
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(219, 196, 155, .035) 80px);
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000);
}

.title-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.sun-disc {
  position: absolute;
  right: 15%;
  top: 19%;
  width: clamp(190px, 23vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 45%, rgba(234, 173, 104, .35), transparent 61%),
    rgb(169, 78, 48);
  box-shadow: 0 0 90px rgba(186, 91, 50, .16);
  opacity: .84;
}

.sun-disc::after {
  content: "";
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(255, 223, 171, .26);
  border-radius: inherit;
}

.dune {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -10%;
  transform-origin: 50% 100%;
}

.dune-back {
  height: 54%;
  bottom: -3%;
  opacity: .65;
  background: #33483b;
  clip-path: polygon(0 73%, 8% 62%, 18% 66%, 29% 48%, 37% 54%, 47% 37%, 57% 56%, 66% 44%, 75% 58%, 86% 43%, 100% 58%, 100% 100%, 0 100%);
}

.dune-mid {
  height: 46%;
  bottom: -4%;
  opacity: .95;
  background:
    linear-gradient(170deg, rgba(219, 183, 123, .11), transparent 35%),
    #243b30;
  clip-path: polygon(0 58%, 10% 48%, 19% 53%, 31% 29%, 44% 51%, 54% 39%, 64% 54%, 74% 30%, 85% 51%, 95% 39%, 100% 49%, 100% 100%, 0 100%);
}

.dune-front {
  height: 33%;
  bottom: -6%;
  opacity: .97;
  background:
    repeating-linear-gradient(165deg, transparent 0, transparent 49px, rgba(234, 206, 155, .04) 50px),
    #182a22;
  clip-path: polygon(0 57%, 12% 45%, 24% 51%, 37% 23%, 51% 48%, 62% 35%, 76% 48%, 89% 28%, 100% 40%, 100% 100%, 0 100%);
}

.wall-silhouette {
  position: absolute;
  right: 17%;
  top: 48%;
  width: 23vw;
  height: 13vw;
  max-width: 360px;
  max-height: 200px;
  border-top: 6px solid rgba(16, 28, 23, .65);
  transform: skewY(-8deg);
}

.tower {
  position: absolute;
  bottom: 0;
  width: 13%;
  height: 66%;
  background: #182820;
  border-radius: 1px 1px 0 0;
}

.tower::before {
  content: "";
  position: absolute;
  left: -34%;
  right: -34%;
  top: -4px;
  height: 5px;
  background: #182820;
}

.tower::after {
  content: "";
  position: absolute;
  left: 37%;
  top: 36%;
  width: 26%;
  height: 32%;
  border-radius: 10px 10px 0 0;
  background: #324337;
}

.tower-a {
  left: 7%;
}

.tower-b {
  left: 44%;
}

.tower-c {
  right: 5%;
}

.caravan-silhouette {
  position: absolute;
  left: 9%;
  bottom: 20%;
  color: rgba(12, 24, 18, .92);
  font-size: clamp(34px, 4.5vw, 70px);
  letter-spacing: .28em;
  transform: rotate(-3deg);
  opacity: .9;
  animation: caravanDrift 8s ease-in-out infinite alternate;
}

.ambient-birds {
  position: absolute;
  top: 19%;
  left: 8%;
  font-size: 23px;
  letter-spacing: 16px;
  color: rgba(239, 218, 178, .38);
  animation: birdsDrift 9s ease-in-out infinite alternate;
}

@keyframes caravanDrift {
  to { transform: translateX(12px) rotate(-3deg); }
}

@keyframes birdsDrift {
  to { transform: translate(17px, -6px); }
}

.title-topline {
  position: absolute;
  top: 38px;
  left: 5.5%;
  right: 5.5%;
  display: flex;
  align-items: center;
  gap: 20px;
  color: rgba(238, 225, 200, .65);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .16em;
}

.title-rule {
  width: 54px;
  height: 1px;
  background: rgba(235, 215, 181, .25);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(680px, 88vw);
  margin-left: clamp(42px, 10vw, 150px);
  padding: 88px 0 52px;
}

.hero-copy .eyebrow {
  color: #c79258;
  margin-bottom: 11px;
  font-size: 11px;
}

.title-english {
  margin-bottom: 15px;
  color: rgba(231, 196, 141, .82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1.25vw, 16px);
  letter-spacing: .32em;
  text-transform: uppercase;
}

.title-lockup {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 34px;
  width: fit-content;
  margin-bottom: 25px;
}

.title-lockup h1 {
  margin: 0;
  color: #f2e5ca;
  font-family: var(--kai);
  font-size: clamp(70px, 8.4vw, 126px);
  font-weight: 400;
  line-height: .92;
  letter-spacing: .08em;
  text-shadow: 0 5px 36px rgba(0, 0, 0, .2);
}

.title-lockup h1 i {
  color: #b2573e;
  font-size: .42em;
  font-style: normal;
  vertical-align: middle;
  opacity: .9;
}

.title-seal {
  width: 57px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  padding: 9px 8px;
  border: 2px solid rgba(178, 87, 63, .84);
  color: #c96c54;
  font-family: var(--kai);
  font-size: 18px;
  line-height: 1.05;
  text-align: center;
  transform: rotate(3deg);
}

.title-subtitle {
  margin-bottom: 14px;
  color: #f1e1c5;
  font-family: var(--kai);
  font-size: clamp(18px, 1.8vw, 25px);
  letter-spacing: .06em;
}

.title-description {
  max-width: 580px;
  margin-bottom: 34px;
  color: rgba(230, 215, 187, .64);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .025em;
}

.title-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.title-actions .button-primary {
  box-shadow: 0 12px 38px rgba(91, 30, 22, .32);
}

.title-actions .button-ghost {
  color: rgba(239, 225, 200, .78);
}

.title-actions .button-ghost:hover {
  background: rgba(255, 247, 229, .07);
}

.title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 30px;
  color: rgba(235, 218, 187, .46);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .11em;
}

.title-meta span {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.title-meta b {
  color: rgba(218, 170, 104, .88);
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 400;
}

.title-footer {
  position: absolute;
  left: 5.5%;
  right: 5.5%;
  bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(230, 215, 190, .42);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .1em;
}

.title-footer .text-button {
  color: rgba(238, 223, 198, .6);
  font-size: 11px;
}

/* Game shell */

.game-screen {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 253, 246, .5), rgba(241, 226, 199, .5)),
    repeating-linear-gradient(96deg, transparent 0, transparent 67px, rgba(102, 78, 45, .035) 68px),
    #e7d6b6;
}

.topbar {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 235, 214, .78);
  backdrop-filter: blur(12px);
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-seal {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 2px solid var(--vermilion);
  color: var(--vermilion);
  background: transparent;
  font-family: var(--kai);
  font-size: 22px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.mini-seal:hover {
  color: var(--paper-light);
  background: var(--vermilion);
  transform: rotate(-3deg);
}

.brand-mini strong {
  display: block;
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .08em;
}

.brand-mini span {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .16em;
}

.season-center {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  text-align: right;
}

.season-kicker {
  grid-column: 1;
  grid-row: 1;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .13em;
}

.season-title {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--kai);
  font-size: 17px;
  white-space: nowrap;
}

.season-title span:first-child {
  color: var(--vermilion);
  font-size: 25px;
}

.season-title i {
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.season-dots {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 9px;
}

.season-dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.season-dot.done {
  border-color: var(--jade);
  background: var(--jade);
}

.season-dot.current {
  width: 10px;
  height: 10px;
  border-color: var(--vermilion);
  background: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(159, 61, 45, .1);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.top-actions .button-outline {
  min-height: 40px;
  padding: 0 12px;
  gap: 9px;
  font-family: var(--kai);
  font-size: 14px;
}

.archive-count {
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--jade);
  font-family: var(--sans);
  font-size: 10px;
}

.game-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 262px minmax(430px, 1fr) 382px;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  padding: 14px 18px 10px;
}

.city-panel,
.map-panel,
.policy-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.city-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
  border: 1px solid rgba(75, 56, 32, .16);
  background: rgba(247, 239, 222, .56);
}

.panel-heading,
.map-heading,
.policy-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.map-heading h2,
.policy-heading h2 {
  margin: 3px 0 0;
  font-family: var(--kai);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: .06em;
}

.weather-badge {
  margin-top: 4px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .08em;
}

.resource-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.resource-row {
  position: relative;
}

.resource-row.is-bumped {
  animation: statBump .45s ease;
}

@keyframes statBump {
  35% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
}

.resource-label {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
}

.resource-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--kai);
  font-size: 13px;
  line-height: 1;
}

.grain-mark {
  color: #6e5327;
  background: rgba(182, 137, 58, .16);
}

.coin-mark {
  color: #426354;
  background: rgba(75, 113, 94, .15);
}

.morale-mark {
  color: #9a4334;
  background: rgba(156, 61, 45, .12);
}

.defense-mark {
  color: #555a4b;
  background: rgba(85, 90, 75, .13);
}

.culture-mark {
  color: #6f5367;
  background: rgba(111, 83, 103, .12);
}

.resource-label > span:nth-child(2) {
  min-width: 0;
}

.resource-label b {
  display: block;
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 400;
}

.resource-label small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-value {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 3px;
  margin: 7px 0 0 38px;
  overflow: hidden;
  background: rgba(58, 47, 31, .1);
}

.meter-fill {
  display: block;
  width: 50%;
  height: 100%;
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}

.grain-fill { background: #a67b38; }
.coin-fill { background: #4b705f; }
.morale-fill { background: #a04b3c; }
.defense-fill { background: #586252; }
.culture-fill { background: #765a70; }

.modifier-block {
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.modifier-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.modifier-title span {
  font-family: var(--kai);
  font-size: 13px;
}

.modifier-title small {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
}

.modifier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  margin-top: 10px;
}

.modifier-grid span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
}

.modifier-grid b {
  margin-left: auto;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.modifier-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.irrigation-dot { background: #718f8a; }
.market-dot { background: #ad8444; }
.watch-dot { background: #77715c; }
.school-dot { background: #80677b; }

.objective-card {
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(92, 70, 39, .16);
  background:
    linear-gradient(135deg, rgba(163, 67, 48, .045), transparent 70%),
    rgba(255, 251, 241, .36);
}

.objective-label {
  display: flex;
  justify-content: space-between;
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .08em;
}

.objective-label span:last-child {
  color: var(--ink-faint);
}

.objective-card p {
  margin: 7px 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.objective-line {
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
}

.objective-line span:first-child {
  color: var(--ink);
  font-weight: 500;
}

.objective-track {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  background: rgba(58, 47, 31, .1);
}

.objective-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--vermilion);
  transition: width .6s ease;
}

/* Map */

.map-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 10px;
  border: 1px solid rgba(75, 56, 32, .16);
  background: rgba(247, 239, 222, .38);
}

.map-heading {
  margin-bottom: 12px;
}

.map-heading .text-button {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 10px;
}

.map-frame {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border: 1px solid rgba(82, 60, 34, .2);
  background: #d7c39a;
  box-shadow: inset 0 0 30px rgba(75, 50, 22, .11), 0 10px 35px rgba(66, 45, 22, .09);
}

.map-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1px solid rgba(93, 69, 38, .2);
  pointer-events: none;
}

.map-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(61, 47, 27, .11), transparent 9%, transparent 91%, rgba(61, 47, 27, .11)),
    linear-gradient(rgba(61, 47, 27, .08), transparent 10%, transparent 90%, rgba(61, 47, 27, .09));
  box-shadow: inset 0 0 36px rgba(82, 56, 26, .08);
}

.dunhuang-map {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.map-season-seal {
  position: absolute;
  z-index: 2;
  top: 24px;
  right: 24px;
  width: 58px;
  height: 69px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--vermilion-dark);
  border: 2px solid rgba(143, 52, 38, .72);
  background: rgba(232, 213, 177, .35);
  transform: rotate(3deg);
  pointer-events: none;
}

.map-season-seal span {
  font-family: var(--kai);
  font-size: 26px;
  line-height: 1;
}

.map-season-seal small {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .2em;
}

.map-spot {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  filter: drop-shadow(0 2px 3px rgba(55, 37, 19, .17));
  transition: transform .2s ease;
}

.map-spot:hover,
.map-spot:focus-visible {
  transform: translateY(-3px) scale(1.04);
}

.spot-pin {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(78, 52, 27, .58);
  border-radius: 50%;
  color: #f7eedb;
  background: rgba(98, 70, 38, .88);
  font-family: var(--kai);
  font-size: 12px;
  transform: none;
}

.spot-pin {
  text-indent: 0;
}

.spot-label {
  padding: 2px 5px;
  color: #3e3220;
  background: rgba(240, 225, 193, .74);
  font-family: var(--kai);
  font-size: 10px;
  white-space: nowrap;
}

.spot-market { left: 49%; top: 42%; }
.spot-post { left: 66%; top: 55%; }
.spot-school { left: 35%; top: 57%; }
.spot-canal { left: 55%; top: 77%; }
.spot-beacon { left: 87%; top: 43%; }

.map-info {
  position: absolute;
  left: 25px;
  bottom: 25px;
  z-index: 6;
  width: min(370px, calc(100% - 50px));
  padding: 17px 40px 17px 18px;
  border: 1px solid rgba(76, 55, 30, .25);
  background: rgba(249, 240, 221, .96);
  box-shadow: 0 14px 32px rgba(53, 37, 17, .22);
  animation: infoIn .25s ease;
}

@keyframes infoIn {
  from { opacity: 0; transform: translateY(5px); }
}

.map-info-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  color: var(--ink-faint);
  background: transparent;
  font-family: var(--sans);
  font-size: 18px;
}

.map-info-index {
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .15em;
}

.map-info h3 {
  margin: 5px 0 7px;
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 400;
}

.map-info p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.dispatch-banner {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-top: 12px;
  padding: 10px 13px;
  border-left: 2px solid var(--vermilion);
  background: rgba(255, 250, 238, .43);
}

.dispatch-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--vermilion-dark);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .09em;
  white-space: nowrap;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(159, 61, 45, .1);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  50% { box-shadow: 0 0 0 6px rgba(159, 61, 45, 0); }
}

.dispatch-banner p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.5;
}

.dispatch-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.dispatch-tags span {
  padding: 3px 6px;
  color: var(--ink-faint);
  background: rgba(72, 98, 83, .075);
  font-family: var(--sans);
  font-size: 8px;
  white-space: nowrap;
}

.chronicle-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 39px;
  margin-top: 6px;
  padding: 4px 5px 0;
  border-top: 1px solid var(--line);
}

.chronicle-label {
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .13em;
  white-space: nowrap;
}

.chronicle-feed {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chronicle-strip .text-button {
  min-height: 30px;
  font-size: 9px;
  white-space: nowrap;
}

/* Policies */

.policy-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
  border: 1px solid rgba(75, 56, 32, .16);
  background: rgba(247, 239, 222, .62);
}

.policy-heading {
  align-items: center;
}

.action-points {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ap-seal {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 2px solid var(--vermilion);
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 18px;
  line-height: 1;
  transform: rotate(2deg);
}

.action-points small {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .04em;
}

.policy-tip {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  margin: 10px 0 11px;
  padding: 7px 10px;
  overflow: hidden;
  background: rgba(162, 124, 57, .07);
}

.ink-swipe {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 38px;
  height: 56px;
  opacity: .09;
  border-radius: 50%;
  background: var(--ink);
  transform: rotate(22deg);
}

.policy-tip p {
  position: relative;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.5;
}

.policy-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 1px 3px 8px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(83, 63, 37, .24) transparent;
}

.policy-grid::-webkit-scrollbar {
  width: 4px;
}

.policy-grid::-webkit-scrollbar-thumb {
  background: rgba(83, 63, 37, .24);
}

.policy-card {
  position: relative;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 11px 10px 9px;
  overflow: hidden;
  border: 1px solid rgba(78, 57, 32, .16);
  border-radius: 1px;
  color: var(--ink);
  background:
    linear-gradient(152deg, rgba(255, 253, 247, .88), rgba(241, 228, 204, .86)),
    var(--paper);
  text-align: left;
  box-shadow: 0 3px 8px rgba(62, 43, 20, .05);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  animation: cardIn .35s both;
}

.policy-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(112, 77, 39, .08);
  border-radius: 50%;
}

.policy-card:nth-child(2) { animation-delay: .025s; }
.policy-card:nth-child(3) { animation-delay: .05s; }
.policy-card:nth-child(4) { animation-delay: .075s; }
.policy-card:nth-child(5) { animation-delay: .1s; }
.policy-card:nth-child(6) { animation-delay: .125s; }
.policy-card:nth-child(7) { animation-delay: .15s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(5px); }
}

.policy-card:not(:disabled):hover {
  z-index: 2;
  border-color: rgba(139, 67, 47, .45);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(62, 43, 20, .1);
}

.policy-card:disabled {
  cursor: not-allowed;
}

.policy-card.insufficient {
  opacity: .5;
  filter: grayscale(.3);
}

.policy-card.used {
  border-color: rgba(74, 103, 89, .46);
  background:
    linear-gradient(150deg, rgba(231, 237, 225, .93), rgba(225, 231, 213, .85)),
    var(--paper);
}

.policy-card.used::before {
  content: "已颁";
  position: absolute;
  top: 24px;
  right: -19px;
  z-index: 1;
  width: 74px;
  padding: 3px 0;
  color: rgba(53, 86, 69, .72);
  border-top: 1px solid rgba(53, 86, 69, .5);
  border-bottom: 1px solid rgba(53, 86, 69, .5);
  font-family: var(--kai);
  font-size: 10px;
  text-align: center;
  transform: rotate(38deg);
}

.policy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.policy-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  border: 1px solid rgba(91, 67, 37, .2);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(130, 102, 63, .08);
  font-family: var(--kai);
  font-size: 11px;
}

.policy-cost {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  white-space: nowrap;
}

.policy-cost.free {
  color: var(--jade);
}

.policy-name {
  display: block;
  margin-top: 8px;
  font-family: var(--kai);
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: .02em;
}

.policy-desc {
  display: block;
  margin-top: 4px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1.55;
}

.policy-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 7px;
}

.effect-chip {
  padding: 2px 4px;
  border-radius: 1px;
  font-family: var(--sans);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.effect-chip.positive {
  color: #315f4b;
  background: rgba(67, 109, 88, .09);
}

.effect-chip.negative {
  color: #8a392c;
  background: rgba(151, 57, 43, .075);
}

.effect-chip.special {
  color: #795821;
  background: rgba(166, 121, 47, .09);
}

.policy-footer {
  flex: 0 0 auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.policy-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
}

.policy-note b {
  color: var(--vermilion);
  font-weight: 500;
}

.policy-footer .button {
  min-height: 47px;
  font-size: 13px;
}

.game-footer {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px 8px;
  color: rgba(50, 57, 48, .53);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .04em;
}

.game-footer span:nth-child(2) {
  text-align: center;
}

/* Modals */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 22, .72);
  backdrop-filter: blur(7px);
  animation: backdropIn .25s ease;
}

@keyframes backdropIn {
  from { opacity: 0; }
}

.event-modal {
  position: relative;
  width: min(900px, 96vw);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
  border: 1px solid rgba(105, 80, 47, .35);
  background: #f3e8d1;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .35);
  animation: modalIn .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 0;
  color: var(--ink-faint);
  background: rgba(250, 244, 231, .8);
  font-size: 20px;
}

.event-visual {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f0dfc0;
  background:
    linear-gradient(155deg, rgba(22, 43, 34, .52), rgba(18, 32, 26, .94)),
    radial-gradient(circle at 50% 40%, #7e4d2f, transparent 65%),
    #1c3027;
}

.event-visual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(227, 191, 131, .18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.event-visual::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(225, 195, 143, .12);
}

.event-pattern {
  position: absolute;
  inset: 0;
  opacity: .2;
  background:
    repeating-radial-gradient(circle at 50% 40%, transparent 0, transparent 35px, rgba(231, 201, 151, .2) 36px, transparent 37px),
    linear-gradient(40deg, transparent 47%, rgba(230, 190, 126, .16) 48%, transparent 49%);
}

.event-symbol {
  position: relative;
  z-index: 2;
  font-family: var(--kai);
  font-size: 104px;
  line-height: 1;
  opacity: .85;
  text-shadow: 0 8px 45px rgba(0, 0, 0, .25);
}

.event-visual-caption {
  position: absolute;
  bottom: 34px;
  left: 34px;
  z-index: 2;
  color: rgba(232, 210, 172, .53);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .3em;
  writing-mode: vertical-rl;
}

.event-content {
  position: relative;
  max-height: 100%;
  overflow-y: auto;
  padding: 32px 40px 30px;
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 65, 36, .25) transparent;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .11em;
}

.event-meta span:last-child {
  padding: 3px 7px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  letter-spacing: .05em;
}

.event-content > h2 {
  margin: 13px 0 10px;
  font-family: var(--kai);
  font-size: 35px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .06em;
}

.event-story {
  margin: 0 0 21px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.85;
}

.event-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-choice {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 11px 15px;
  border: 1px solid rgba(82, 61, 35, .18);
  color: var(--ink);
  background: rgba(255, 252, 245, .5);
  text-align: left;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.event-choice:hover {
  border-color: rgba(151, 61, 45, .55);
  background: rgba(255, 252, 245, .9);
  transform: translateX(3px);
}

.event-choice:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.event-choice-text b {
  display: block;
  margin-bottom: 3px;
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 400;
}

.event-choice-text small {
  display: block;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.5;
}

.event-choice-effects {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  max-width: 145px;
}

.event-choice-effects span {
  font-family: var(--sans);
  font-size: 8px;
  white-space: nowrap;
}

.event-choice-effects .positive { color: #35624f; }
.event-choice-effects .negative { color: #913b2e; }
.event-choice-effects .special { color: #7a5a24; }

.event-result {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0 15px;
}

.result-stamp {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--vermilion);
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 20px;
  transform: rotate(-3deg);
}

.event-result h3 {
  margin: 4px 0 6px;
  font-family: var(--kai);
  font-size: 24px;
  font-weight: 400;
}

.event-result > div:nth-child(2) p {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.75;
}

.event-effects,
.history-note,
.season-settlement,
.event-result .button {
  grid-column: 1 / -1;
}

.event-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 3px 0 14px;
}

.event-effects span {
  padding: 4px 7px;
  background: rgba(77, 106, 87, .08);
  font-family: var(--sans);
  font-size: 9px;
}

.event-effects span.negative {
  color: #8e3b2e;
  background: rgba(151, 55, 41, .07);
}

.history-note {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 11px;
  margin-bottom: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(171, 129, 58, .055);
}

.history-note-mark {
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 21px;
  line-height: 1;
  text-align: center;
}

.history-note p {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.75;
}

.history-note small {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1.5;
}

.season-settlement {
  margin-bottom: 14px;
}

.settlement-title {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .12em;
}

.settlement-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
}

.settlement-lines b {
  font-weight: 500;
}

.settlement-lines .positive { color: #35624f; }
.settlement-lines .negative { color: #913b2e; }

.event-result .button {
  min-height: 49px;
  margin-top: 2px;
}

/* Archive and help */

.archive-modal {
  position: relative;
  width: min(880px, 95vw);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(91, 69, 40, .34);
  background: #f1e6cf;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  animation: modalIn .3s ease;
}

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 15px;
  border-bottom: 1px solid var(--line);
}

.archive-header h2 {
  margin: 3px 0 0;
  font-family: var(--kai);
  font-size: 30px;
  font-weight: 400;
}

.archive-header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.archive-progress {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10px;
}

.archive-progress b {
  color: var(--vermilion);
  font-size: 17px;
  font-weight: 500;
}

.archive-tabs {
  display: flex;
  gap: 22px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.archive-tab {
  position: relative;
  padding: 13px 0 11px;
  border: 0;
  color: var(--ink-faint);
  background: transparent;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .08em;
}

.archive-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}

.archive-tab.active {
  color: var(--vermilion);
}

.archive-tab.active::after {
  background: var(--vermilion);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 18px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 65, 36, .25) transparent;
}

.archive-entry {
  min-height: 138px;
  padding: 14px;
  border: 1px solid rgba(82, 61, 35, .15);
  background: rgba(255, 252, 244, .38);
}

.archive-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.archive-type {
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .14em;
}

.archive-entry-index {
  color: var(--ink-faint);
  font-family: var(--kai);
  font-size: 11px;
}

.archive-entry h3 {
  margin: 8px 0 5px;
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 400;
}

.archive-entry p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.7;
}

.archive-entry small {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1.5;
}

.archive-entry.locked {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  background: rgba(78, 67, 48, .035);
  text-align: center;
}

.locked-mark {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 61, 35, .19);
  border-radius: 50%;
  font-family: var(--kai);
  font-size: 13px;
}

.archive-entry.locked b {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .15em;
}

.archive-entry.locked small {
  margin: 0;
}

.archive-footnote {
  margin: 0;
  padding: 10px 26px 15px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  text-align: center;
}

.help-modal {
  position: relative;
  width: min(510px, 95vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px 32px;
  border: 1px solid rgba(91, 69, 40, .34);
  background: #f2e7d0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  animation: modalIn .3s ease;
}

.help-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.help-modal h2 {
  margin: 7px 0 24px;
  font-family: var(--kai);
  font-size: 30px;
  font-weight: 400;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.help-step {
  display: grid;
  grid-template-columns: 37px 1fr;
  gap: 13px;
}

.help-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 14px;
  border-radius: 50%;
}

.help-step b {
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 400;
}

.help-step p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.help-callout {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  margin: 24px 0 18px;
  padding: 12px;
  border-left: 2px solid var(--gold);
  background: rgba(172, 130, 57, .06);
}

.help-callout span {
  color: #7a5a24;
  font-family: var(--kai);
  font-size: 13px;
}

.help-callout p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.65;
}

.log-modal {
  position: relative;
  width: min(620px, 95vw);
  max-height: min(700px, calc(100vh - 48px));
  overflow: hidden;
  padding: 24px 26px;
  border: 1px solid rgba(91, 69, 40, .34);
  background: #f2e7d0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  animation: modalIn .3s ease;
}

.log-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.log-modal h2 {
  margin: 3px 0 0;
  font-family: var(--kai);
  font-size: 28px;
  font-weight: 400;
}

.log-list {
  max-height: min(580px, calc(100vh - 170px));
  overflow-y: auto;
  padding: 4px 5px 4px 0;
}

.log-empty {
  margin: 40px 0;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 11px;
  text-align: center;
}

.log-entry {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.log-entry-date {
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 12px;
}

.log-entry h3 {
  margin: 0 0 4px;
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 400;
}

.log-entry p {
  margin: 0;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.6;
}

.about-modal p {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.8;
}

.about-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-source b {
  width: 100%;
  margin-bottom: 3px;
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 9px;
}

.about-source span {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
}

.about-source span:not(:last-child)::after {
  content: "·";
  margin-left: 6px;
}

/* Result */

.result-screen {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 40px 20px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(233, 203, 151, .75), transparent 35%),
    linear-gradient(140deg, #d8c198, #eadbc0 45%, #cfb587);
}

.result-screen::before,
.result-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -10%;
  right: -10%;
  bottom: -20%;
  height: 54%;
  background: rgba(193, 162, 112, .35);
  clip-path: polygon(0 54%, 11% 37%, 21% 47%, 34% 20%, 45% 46%, 57% 31%, 70% 49%, 82% 24%, 100% 45%, 100% 100%, 0 100%);
}

.result-screen::after {
  bottom: -27%;
  height: 58%;
  background: rgba(123, 101, 67, .18);
  transform: scaleX(-1);
}

.result-rays {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: -1;
  width: 850px;
  height: 850px;
  opacity: .22;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(147, 98, 48, .42) 0deg 0.8deg, transparent 0.8deg 8deg);
  mask-image: radial-gradient(circle, transparent 0 9%, #000 38%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: slowRays 90s linear infinite;
}

@keyframes slowRays {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.result-card {
  width: min(650px, 100%);
  padding: 35px 44px 24px;
  border: 1px solid rgba(84, 61, 33, .22);
  background:
    linear-gradient(135deg, rgba(255, 253, 245, .82), rgba(239, 225, 199, .86)),
    var(--paper);
  box-shadow: 0 30px 80px rgba(71, 48, 20, .18);
  text-align: center;
  animation: modalIn .55s ease;
}

.result-seal {
  width: 72px;
  height: 84px;
  display: grid;
  place-items: center;
  margin: 13px auto 11px;
  border: 3px double var(--vermilion);
  color: var(--vermilion);
  font-family: var(--kai);
  font-size: 35px;
  transform: rotate(-2deg);
}

.result-card h1 {
  margin: 0 0 7px;
  font-family: var(--kai);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: .13em;
}

.result-subtitle {
  margin-bottom: 24px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: .06em;
}

.result-score-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.result-score-main {
  text-align: center;
  border-right: 1px solid var(--line);
}

.result-score-main span {
  display: block;
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 44px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.result-score-main small {
  display: block;
  margin-top: 6px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .12em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.result-stat {
  min-width: 0;
  text-align: center;
}

.result-stat b {
  display: block;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.result-stat span {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
}

.result-achievements,
.result-lesson {
  margin-top: 20px;
  text-align: left;
}

.result-section-label {
  display: block;
  margin-bottom: 9px;
  color: var(--vermilion);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .16em;
}

.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.achievement {
  padding: 5px 8px;
  border: 1px solid rgba(75, 94, 75, .22);
  color: #425b4c;
  background: rgba(75, 103, 83, .055);
  font-family: var(--sans);
  font-size: 9px;
}

.result-lesson {
  padding: 13px 15px;
  border-left: 2px solid var(--gold);
  background: rgba(167, 123, 56, .055);
}

.result-lesson .result-section-label {
  margin-bottom: 5px;
  color: #7a5a24;
}

.result-lesson p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 8px;
}

/* Toasts and floating values */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  border-left: 2px solid #d6a25c;
  color: #f6eddd;
  background: rgba(27, 42, 35, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.5;
  animation: toastIn .25s ease;
}

.toast.out {
  animation: toastOut .25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(6px); }
}

.floating-effect {
  position: fixed;
  z-index: 310;
  padding: 4px 7px;
  border-radius: 1px;
  color: #f8f0df;
  background: rgba(40, 69, 55, .93);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
  font-family: var(--sans);
  font-size: 10px;
  pointer-events: none;
  animation: floatAway 1.1s ease forwards;
}

.floating-effect.negative {
  background: rgba(143, 54, 41, .93);
}

@keyframes floatAway {
  from { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; }
  to { opacity: 0; transform: translateY(-26px); }
}

/* Responsive */

@media (max-width: 1280px) {
  .game-layout {
    grid-template-columns: 240px minmax(390px, 1fr) 354px;
    gap: 11px;
    padding-left: 13px;
    padding-right: 13px;
  }

  .city-panel,
  .policy-panel {
    padding-left: 13px;
    padding-right: 13px;
  }

  .policy-card {
    min-height: 126px;
    padding: 9px 8px 8px;
  }

  .policy-name {
    font-size: 15px;
  }

  .dispatch-tags {
    display: none;
  }

  .dispatch-banner {
    grid-template-columns: 78px 1fr;
  }
}

@media (max-width: 1080px) {
  .game-screen {
    height: auto;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .season-center {
    grid-row: 1;
    grid-column: 2;
    margin-right: 140px;
  }

  .top-actions {
    position: absolute;
    right: 18px;
    top: 22px;
  }

  .game-layout {
    grid-template-columns: 236px minmax(0, 1fr);
    height: auto;
  }

  .policy-panel {
    grid-column: 1 / -1;
    min-height: 360px;
  }

  .policy-grid {
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
  }

  .policy-footer {
    display: grid;
    grid-template-columns: 1fr 280px;
    align-items: center;
    gap: 20px;
  }

  .policy-note {
    margin: 0;
  }

  .map-frame {
    min-height: 520px;
  }
}

@media (max-width: 820px) {
  .title-topline {
    top: 24px;
  }

  .title-topline span:first-child,
  .title-rule {
    display: none;
  }

  .hero-copy {
    margin: 0 auto;
    padding: 100px 0 80px;
  }

  .title-lockup h1 {
    font-size: clamp(65px, 17vw, 100px);
  }

  .title-seal {
    width: 48px;
    height: 61px;
    font-size: 15px;
  }

  .wall-silhouette {
    right: 3%;
    top: 38%;
    width: 35vw;
    height: 20vw;
  }

  .sun-disc {
    right: 4%;
    top: 15%;
  }

  .title-description {
    font-size: 12px;
  }

  .title-footer {
    bottom: 17px;
  }

  .title-footer span:first-child {
    max-width: 60%;
    line-height: 1.5;
  }

  .topbar {
    min-height: 72px;
    grid-template-columns: 44px 1fr auto;
    padding: 10px 13px;
  }

  .brand-mini {
    grid-column: 1;
    grid-row: 1;
  }

  .brand-mini > div {
    display: none;
  }

  .season-center {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin-right: 0;
    padding-left: 0;
    text-align: center;
  }

  .season-title {
    justify-content: center;
  }

  .season-dots {
    display: none;
  }

  .top-actions {
    position: static;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .top-actions .button-outline {
    min-width: 72px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .top-actions .icon-button:first-child {
    display: none;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .city-panel {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .resource-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-top: 15px;
  }

  .modifier-block {
    margin-top: 16px;
  }

  .modifier-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .objective-card {
    display: none;
  }

  .map-panel {
    padding: 14px;
  }

  .map-frame {
    min-height: min(520px, 67vw);
  }

  .map-heading .text-button {
    display: none;
  }

  .dispatch-banner {
    grid-template-columns: 70px 1fr;
  }

  .policy-panel {
    min-height: 0;
    padding: 14px;
  }

  .policy-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: none;
  }

  .policy-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .policy-note {
    margin-bottom: 0;
  }

  .game-footer {
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 12px 10px;
    text-align: center;
  }

  .game-footer span:nth-child(2) {
    display: none;
  }

  .event-modal {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
  }

  .event-visual {
    min-height: 126px;
  }

  .event-symbol {
    font-size: 63px;
  }

  .event-visual-caption {
    right: 28px;
    bottom: 23px;
    left: auto;
  }

  .event-content {
    overflow: visible;
    padding: 24px;
  }

  .modal-layer {
    padding: 15px;
  }

  .archive-modal {
    max-height: calc(100vh - 30px);
  }

  .archive-grid {
    grid-template-columns: 1fr;
    padding: 14px 20px;
  }
}

@media (max-width: 560px) {
  .title-screen {
    align-items: flex-start;
  }

  .title-topline {
    left: 24px;
    right: 24px;
  }

  .hero-copy {
    width: calc(100% - 48px);
    padding-top: 92px;
  }

  .title-lockup {
    gap: 17px;
  }

  .title-lockup h1 {
    font-size: clamp(59px, 21vw, 84px);
  }

  .title-seal {
    width: 43px;
    height: 55px;
    margin-bottom: 3px;
  }

  .title-subtitle {
    font-size: 17px;
    line-height: 1.6;
  }

  .title-description {
    margin-bottom: 24px;
    font-size: 11px;
    line-height: 1.75;
  }

  .title-meta {
    gap: 17px;
    margin-top: 22px;
  }

  .wall-silhouette,
  .caravan-silhouette {
    opacity: .55;
  }

  .title-footer span:first-child {
    font-size: 8px;
  }

  .game-layout {
    padding: 7px;
    gap: 7px;
  }

  .city-panel,
  .map-panel,
  .policy-panel {
    padding: 12px;
  }

  .panel-heading h2,
  .map-heading h2,
  .policy-heading h2 {
    font-size: 20px;
  }

  .resource-stack {
    gap: 10px 11px;
  }

  .resource-label {
    grid-template-columns: 28px 1fr auto;
    gap: 6px;
  }

  .resource-label small {
    display: none;
  }

  .resource-value {
    font-size: 15px;
  }

  .modifier-grid {
    grid-template-columns: 1fr 1fr;
  }

  .map-heading {
    align-items: center;
  }

  .map-frame {
    min-height: 360px;
  }

  .map-season-seal {
    top: 15px;
    right: 15px;
    width: 47px;
    height: 57px;
  }

  .map-season-seal span {
    font-size: 21px;
  }

  .spot-pin {
    width: 25px;
    height: 25px;
    font-size: 10px;
  }

  .spot-label {
    font-size: 9px;
  }

  .spot-market { left: 48%; top: 38%; }
  .spot-post { left: 63%; top: 54%; }
  .spot-school { left: 34%; top: 58%; }
  .spot-canal { left: 54%; top: 78%; }
  .spot-beacon { left: 84%; top: 44%; }

  .dispatch-banner {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .chronicle-strip {
    gap: 8px;
  }

  .chronicle-feed {
    font-size: 9px;
  }

  .policy-grid {
    grid-template-columns: 1fr;
  }

  .policy-card {
    min-height: 113px;
  }

  .policy-name {
    font-size: 17px;
  }

  .policy-desc {
    font-size: 9px;
  }

  .event-modal {
    width: 100%;
  }

  .event-content {
    padding: 19px;
  }

  .event-content > h2 {
    font-size: 29px;
  }

  .event-choice {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .event-choice-effects {
    justify-content: flex-start;
    max-width: none;
  }

  .archive-header {
    padding: 18px 18px 13px;
  }

  .archive-tabs {
    padding: 0 18px;
  }

  .archive-grid {
    padding: 12px 17px;
  }

  .help-modal {
    padding: 25px 20px;
  }

  .result-card {
    padding: 28px 18px 20px;
  }

  .result-card h1 {
    font-size: 35px;
  }

  .result-score-row {
    grid-template-columns: 1fr;
  }

  .result-score-main {
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-stats {
    gap: 5px;
  }

  .result-actions .button {
    padding: 0 14px;
  }

  .result-footer {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
