:root {
  --ink: #233e33;
  --green: #214b3b;
  --deep: #153b30;
  --gold: #e6bd69;
  --muted: #655f4e;
  --line: #c7baa0;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  --mono: "Courier New", monospace;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    16px/1.65 "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    sans-serif;
  background-color: #f4efdf;
  background-image:
    linear-gradient(90deg, #90806309 1px, transparent 1px),
    linear-gradient(#90806309 1px, transparent 1px);
  background-size: 16px 16px;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
label:has(input:focus-visible) span {
  outline: 3px solid #c6782e;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}
button {
  border: 0;
}
a {
  color: inherit;
}
header {
  color: #faf1d8;
  background: #183d32;
  border-bottom: 3px solid #bda166;
  box-shadow: 0 2px 0 #23382a;
  position: relative;
}
.bar {
  width: min(1152px, calc(100% - 72px));
  height: 66px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand img {
  width: 42px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 0 #10271f);
}
nav,
.tools {
  display: flex;
  gap: 24px;
  align-items: center;
}
nav {
  align-self: stretch;
}
nav button,
.tools button {
  background: transparent;
  color: #e7e2cf;
  font-weight: 600;
  font-size: 14px;
}
nav button {
  height: 100%;
  padding: 0 2px;
  border-bottom: 3px solid transparent;
}
nav button.active {
  border-color: #edce7d;
  color: #ffe6a0;
}
.tools {
  margin-left: auto;
  gap: 14px;
}
.tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 7px;
}
.tools svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sound {
  border: 1px solid #8a9c80;
  padding: 2px 11px;
  border-radius: 4px;
}
#help {
  width: 36px;
  color: #f0d69a;
  border: 1px solid #80937c;
  border-radius: 50%;
  font: 700 18px Georgia;
}
main {
  width: min(1152px, calc(100% - 72px));
  margin: 32px auto 0;
  outline: none;
  min-height: 70vh;
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--deep);
  border: 3px solid #344536;
  box-shadow:
    0 4px 0 #a89972,
    inset 0 0 0 2px #bca574;
  color: #fff6db;
  min-height: 354px;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #d2b57b86;
  z-index: -1;
  pointer-events: none;
}
.landscape {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 26%;
  background: url(./art/morning.webp) 63% 48% / cover no-repeat;
}
.landscape:after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #153b30 0%,
      #153b30ed 9%,
      #153b3080 30%,
      transparent 48%
    ),
    linear-gradient(0deg, #1a2d1d50, transparent 24%);
}
.hero-content {
  padding: 34px 42px 35px;
  position: relative;
  width: 60%;
}
.hero-label,
.eyebrow,
.location,
.time,
.status,
.step {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.075em;
}
.hero-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #eed99c;
}
.hero-label span {
  color: #f0ca76;
}
.hero h1,
.diploma h1 {
  font: 800 clamp(36px, 4.5vw, 62px)/1.22 var(--serif);
  letter-spacing: 0.045em;
  text-shadow: 1px 3px 0 #092d27;
  margin: 13px 0;
}
.hero h1 span {
  display: block;
  color: #ffe4a4;
}
.hero p {
  font-size: 15px;
  line-height: 1.8;
  color: #f6f2df;
}
.gold,
.primary,
.outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 45px;
  padding: 9px 22px;
  border: 1px solid #826c3c;
  border-radius: 4px;
  font-weight: 750;
  text-decoration: none;
}
.gold {
  margin-top: 19px;
  background: #f4d788;
  color: #2f4634;
  border: 2px solid #b7974e;
  box-shadow:
    inset 0 0 0 2px #ffe8a9,
    0 3px #655b31;
  font-size: 16px;
}
.gold b {
  font-size: 14px;
}
.hero small {
  display: inline-block;
  font-size: 13px;
  margin-left: 17px;
  color: #ecdec1;
}
.hero small i {
  display: inline-block;
  height: 11px;
  border-left: 1px solid #b7ab8a;
  margin: 0 7px;
}
.location {
  position: absolute;
  right: 19px;
  bottom: 19px;
  padding: 4px 11px;
  background: #1b3027db;
  border: 1px solid #ccba8a;
  letter-spacing: 0.02em;
  color: #fff4d3;
}
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid #eacf8b;
  pointer-events: none;
}
.corner:after {
  content: "";
  position: absolute;
  background: #eacf8b;
  width: 4px;
  height: 4px;
  left: 3px;
  top: 3px;
}
.tl {
  top: 4px;
  left: 4px;
  border-right: 0;
  border-bottom: 0;
}
.tr {
  right: 4px;
  top: 4px;
  transform: rotate(90deg);
  border-right: 0;
  border-bottom: 0;
}
.bl {
  bottom: 4px;
  left: 4px;
  transform: rotate(-90deg);
  border-right: 0;
  border-bottom: 0;
}
.br {
  right: 4px;
  bottom: 4px;
  transform: rotate(180deg);
  border-right: 0;
  border-bottom: 0;
}
.quest-list {
  margin: 31px 0 22px;
}
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}
.eyebrow {
  display: block;
  font: 700 12px/1.4 var(--mono);
  letter-spacing: 0.15em;
  color: #75633e;
}
.section-title h2,
.paper h2,
.ending h2,
dialog h2,
.reward h2 {
  font: 800 29px/1.45 var(--serif);
  letter-spacing: 0.05em;
}
.section-title h2 {
  margin-top: 3px;
}
.progress {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
}
.progress strong {
  font: 700 17px var(--mono);
}
.progress div {
  grid-column: span 2;
  display: flex;
  gap: 4px;
}
.progress i {
  height: 5px;
  flex: 1;
  background: #d6ccb5;
}
.progress i.filled,
.track .lit {
  background: #61895d;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.mission {
  overflow: hidden;
  padding: 0;
  text-align: left;
  background: #fffbed;
  border: 1px solid #ac9c7d;
  border-radius: 5px;
  box-shadow: 0 3px 0 #c5b899;
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.mission:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 #c5b899;
}
.mission.m0 {
  border-color: #9a8153;
}
.object {
  height: 114px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: var(--wash);
  background-image:
    radial-gradient(ellipse at 50% 77%, #60513331 0 10%, transparent 11%),
    radial-gradient(ellipse at center, #fff8e84d, transparent 70%),
    radial-gradient(var(--dots) 0.9px, transparent 1px);
  background-size:
    auto,
    auto,
    8px 8px;
  border-bottom: 1px solid var(--line);
}
.m0 {
  --wash: #eddab0;
  --dots: #cfb988;
}
.m1 {
  --wash: #dce4ca;
  --dots: #bbcbab;
}
.m2 {
  --wash: #d9e2df;
  --dots: #b8c9c2;
}
.object img {
  position: relative;
  height: 95px;
  width: auto;
  image-rendering: pixelated;
  transform: rotate(-7deg);
  filter: drop-shadow(3px 4px 0 #4c47331c);
}
.m1 .object img,
.m2 .object img {
  transform: none;
}
.time {
  position: absolute;
  top: 10px;
  left: 13px;
  background: #fff9e6bc;
  color: #575744;
  border: 1px solid #a9a08388;
  border-radius: 3px;
  padding: 0 7px;
  font-size: 12px;
}
.spark {
  position: absolute;
  color: #a18c5a;
  font-style: normal;
}
.sp1 {
  left: 32%;
  top: 25%;
  font-size: 15px;
}
.sp2 {
  right: 31%;
  bottom: 19%;
  font-size: 17px;
}
.card-body {
  padding: 15px 19px 12px;
}
.card-body h3 {
  font: 800 clamp(19px, 2vw, 24px)/1.6 var(--serif);
  letter-spacing: 0.025em;
}
.card-body p {
  font-size: 14px;
  color: #655f4e;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed #ccbea2;
  padding-top: 9px;
  margin-top: 12px;
  font-size: 13px;
  color: #6d6756;
}
.status {
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ready {
  color: #356443;
}
.guide {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 12px 23px;
  background: #fbf7e9;
  border: 1px solid var(--line);
  border-left: 4px solid #778a60;
  box-shadow: 0 2px 0 #d8cfb7;
  border-radius: 3px;
}
.guide img {
  height: 60px;
  width: 60px;
  object-fit: contain;
  image-rendering: pixelated;
}
.guide strong {
  font-size: 14px;
  color: #356443;
}
.guide p {
  font-size: 15px;
  margin-top: 1px;
}
.primary {
  background: var(--green);
  color: #fff5d3;
  border: 2px solid #425d43;
  box-shadow:
    inset 0 0 0 1px #73846a,
    0 2px 0 #25392b;
}
.primary:hover,
.gold:hover {
  filter: brightness(1.08);
}
.outline {
  background: #fbf7e9;
}
.back {
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 0;
  margin-bottom: 8px;
}
.back:hover {
  text-decoration: underline;
}
footer {
  text-align: center;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  margin: 30px auto 22px;
  color: #756c52;
}
footer span {
  color: #a58e61;
  margin: 0 9px;
}
.chapter-head {
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(90deg, #173c31 10%, #173c31df 50%, #173c314a),
    var(--scene) right 45% / cover;
  color: #fff3d8;
  border: 3px double #c6ac70;
}
.chapter-head .eyebrow,
.diploma .eyebrow {
  color: #ead292;
}
.chapter-head h1 {
  font: 800 34px/1.5 var(--serif);
}
.chapter-head p {
  font-size: 14px;
}
.step {
  background: #193d31e0;
  padding: 3px 10px;
  border: 1px solid #bbad86;
  white-space: nowrap;
}
.track {
  display: flex;
  gap: 4px;
  margin: 9px 0 15px;
}
.track i {
  flex: 1;
  height: 5px;
  background: #d6ccb5;
}
.work {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  align-items: start;
  gap: 28px;
  margin-top: 22px;
}
.slip,
.paper,
.reward,
.ending,
#answer {
  background: #fffbef;
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 34px);
  border-radius: 4px;
  box-shadow: 0 3px #d5cbb2;
}
.slip {
  background: #fffdf5;
  border-bottom: 4px double #c7baa0;
}
.slip h3 {
  font: 800 25px var(--serif);
  margin: 9px 0 4px;
}
.slip small,
.subtle,
.save-note {
  color: #696350;
  font-size: 14px;
}
.slip dl {
  border-top: 1px dashed #a99e84;
  border-bottom: 1px dashed #a99e84;
  padding: 12px 0;
  margin: 18px 0;
}
.slip dl div,
.entries li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.slip dd {
  font-weight: 650;
  text-align: right;
}
.slip-end {
  text-align: center;
  font: 14px var(--serif);
  color: #897a5d;
}
#answer > .eyebrow:before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 25px;
  height: 24px;
  background: url(./art/quill.png) center/contain no-repeat;
  image-rendering: pixelated;
  margin-right: 6px;
}
#answer h2 {
  font: 800 24px/1.6 var(--serif);
  margin: 5px 0 16px;
}
.amount,
legend {
  font-weight: bold;
  font-size: 15px;
}
.amount > span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.amount input {
  min-width: 0;
  width: 100%;
  background: #fffef8;
  border: 1px solid #a89b7b;
  padding: 9px 12px;
  border-radius: 3px;
  font-size: 18px;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.choices label {
  cursor: pointer;
  position: relative;
}
.choices input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choices span {
  display: block;
  background: #fffdf6;
  border: 1px solid #b9ae94;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 15px;
}
.choices input:checked + span {
  background: #e0ead9;
  border-color: #39634a;
  box-shadow: inset 0 0 0 1px #39634a;
}
.choices input:checked + span:before {
  content: "✓ ";
  font-weight: bold;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 12px 0;
}
legend {
  padding: 0;
  margin-bottom: 5px;
}
.subtle {
  margin: 13px 0;
}
#hint:not(:empty) {
  background: #fff0d3;
  border-left: 3px solid #a76a30;
  padding: 10px 13px;
  font-size: 15px;
  margin: 12px 0;
}
#answer .primary {
  margin-top: 8px;
}
.save-note {
  text-align: center;
  margin: 18px auto;
}
.reward,
.ending,
.diploma {
  text-align: center;
  margin-top: 22px;
}
.reward p,
.ending p,
.paper > p {
  margin: 10px 0 20px;
}
.seal {
  display: grid;
  place-items: center;
  background: #e3edd7;
  color: #48754e;
  width: 58px;
  height: 58px;
  border-radius: 100%;
  margin: 0 auto 13px;
  font-size: 28px;
  border: 3px double #74936c;
}
.paper {
  max-width: 800px;
  margin: auto;
}
.totals {
  display: flex;
  gap: 12px;
}
.totals div {
  flex: 1;
  background: #e9eddf;
  padding: 12px 16px;
  font-size: 14px;
}
.totals strong,
.entries small {
  display: block;
}
.totals strong {
  font-size: 23px;
}
.entries {
  list-style: none;
  padding: 0;
}
.entries li {
  border-bottom: 1px dashed var(--line);
  align-items: center;
}
.entries small {
  font-size: 13px;
  color: var(--muted);
}
.diploma {
  margin: 0 0 18px;
  background: #214a3c;
  color: #fff2cf;
  padding: 30px 16px;
  border: 5px double #ceb882;
}
.diploma img {
  width: 100px;
  image-rendering: pixelated;
}
.diploma h1 {
  font-size: clamp(32px, 5vw, 50px);
}
.sign {
  color: #eed693;
  font: 18px var(--serif);
  margin-top: 18px;
}
.ending .back {
  margin: 14px 12px 0;
}
dialog {
  color: var(--ink);
  width: min(460px, 90%);
  max-height: 85svh;
  border: 4px double #9a895f;
  border-radius: 5px;
  padding: 26px;
  background: #fcf6e5;
  box-shadow: 0 15px 60px #15251f44;
}
dialog::backdrop {
  background: #122b23a8;
}
dialog p {
  margin: 12px 0 15px;
}
dialog form {
  margin-top: 15px;
}
@media (max-width: 850px) {
  .bar,
  main {
    width: calc(100% - 40px);
  }
  .hero-content {
    padding: 30px;
    width: 65%;
  }
  .hero small {
    display: block;
    margin: 12px 0 0;
  }
  .cards {
    gap: 12px;
  }
  .card-body {
    padding: 12px;
  }
  .tools,
  nav {
    gap: 12px;
  }
}
@media (max-width: 650px) {
  .bar {
    height: auto;
    min-height: 58px;
    padding-top: 8px;
    flex-wrap: wrap;
    gap: 0;
    width: calc(100% - 30px);
  }
  .brand {
    font-size: 18px;
    gap: 4px;
  }
  .brand img {
    width: 34px;
  }
  .tools {
    gap: 8px;
  }
  .tools button {
    font-size: 12px;
  }
  #help {
    width: 32px;
    min-height: 32px;
  }
  nav {
    order: 3;
    width: 100%;
    gap: 21px;
  }
  nav button {
    padding: 7px 2px;
  }
  .bar .tools {
    margin-left: auto;
  }
  main {
    width: calc(100% - 26px);
    margin-top: 16px;
  }
  .hero {
    min-height: 0;
  }
  .landscape {
    inset: 0 0 auto;
    height: 210px;
    background-position: center 43%;
  }
  .landscape:after {
    background: linear-gradient(0deg, #153b30, transparent 42%);
  }
  .hero-content {
    padding: 168px 20px 26px;
    width: 100%;
  }
  .hero h1 {
    font-size: clamp(29px, 7.4vw, 43px);
    margin: 8px 0 10px;
  }
  .hero h1 span {
    display: inline;
  }
  .hero p {
    font-size: 14px;
  }
  .hero small {
    display: inline-block;
    font-size: 12px;
    margin: 0 0 0 9px;
  }
  .hero .gold {
    padding: 7px 12px;
    font-size: 14px;
    margin-top: 14px;
  }
  .location {
    top: 12px;
    right: 12px;
    bottom: auto;
    font-size: 11px;
  }
  .quest-list {
    margin-top: 23px;
  }
  .section-title h2 {
    font-size: 25px;
  }
  .progress {
    font-size: 12px;
    gap: 3px 7px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mission {
    display: grid;
    grid-template-columns: 30% 1fr;
  }
  .object {
    height: 100%;
    min-height: 110px;
    border: 0;
    border-right: 1px solid var(--line);
  }
  .object img {
    height: auto;
    width: 78%;
    max-width: 92px;
    margin-top: 12px;
  }
  .time {
    top: 6px;
    left: 7px;
  }
  .sp1 {
    left: 12%;
  }
  .sp2 {
    right: 9%;
  }
  .card-body h3 {
    font-size: 20px;
  }
  .card-body p {
    font-size: 13px;
  }
  .card-foot {
    margin-top: 7px;
    padding-top: 6px;
  }
  .guide {
    gap: 11px;
    padding: 11px;
  }
  .guide img {
    width: 46px;
    height: 46px;
  }
  .guide p {
    font-size: 14px;
  }
  .work {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  .chapter-head {
    padding: 17px 12px;
  }
  .chapter-head h1 {
    font-size: 24px;
  }
  .chapter-head .eyebrow,
  .step {
    font-size: 12px;
  }
  .slip,
  #answer {
    padding: 17px;
  }
  .slip dl {
    margin: 10px 0;
    padding: 8px 0;
  }
  .slip dl div {
    padding: 3px 0;
  }
  .totals {
    gap: 6px;
  }
  .totals div {
    padding: 9px;
  }
  .ending h2 {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
