:root {
  --jade: #103c39;
  --deep: #0a2f2d;
  --gold: #e4bd6b;
  --ivory: #fbf4df;
  --ink: #193e38;
  --muted: #a0b9ad;
  --line: #d6caa7;
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ivory);
  background: var(--deep);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 36%, #286057 0, #123f3b 50%, #092c2a 100%);
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  -webkit-touch-callout: none;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #f4c965;
  outline-offset: 4px;
}
button {
  border: 0;
}
button:disabled {
  cursor: default;
}
.museum-game {
  max-width: 1250px;
  min-height: 100svh;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(320px, 420px) minmax(220px, 1fr);
  gap: 32px 46px;
  padding: 36px 40px 20px;
  align-items: center;
}
.brand {
  align-self: center;
  padding-bottom: 35px;
}
.brand-kicker {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: #bdd2bb;
}
.seal {
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--jade);
  width: 34px;
  height: 38px;
  border-radius: 5px;
  font:
    24px Georgia,
    "Songti SC",
    serif;
}
.brand h1 {
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.12em;
  margin: 28px 0 12px;
  white-space: nowrap;
}
.brand h1 span {
  display: block;
  font-size: 32px;
  color: var(--gold);
  letter-spacing: 0.2em;
}
.brand-note {
  font-size: 14px;
  color: #bdd2bb;
  letter-spacing: 0.07em;
  line-height: 1.8;
}
.desktop-intro {
  margin-top: 62px;
}
.intro-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  font-size: 14px;
  color: #b4cbbc;
}
.intro-rule b {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 17px;
  font-weight: 400;
  opacity: 0.8;
}
.intro-rule p {
  margin: 0;
}
.small-stamp {
  border: 1px solid #8b9e79;
  border-radius: 5px;
  color: #d3d2a4;
  font-family: serif;
  font-size: 17px;
  letter-spacing: 0.14em;
  line-height: 1.7;
  text-align: center;
  width: 80px;
  transform: rotate(-6deg);
  padding: 7px 4px;
  margin-top: 38px;
  opacity: 0.7;
}
.play-column {
  width: 100%;
  max-width: 420px;
  margin: auto;
}
.scorebar {
  height: 79px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 6px 14px;
}
.scorebar span {
  display: block;
  color: #bfd0bc;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.score-primary strong {
  font-family: Georgia, serif;
  font-size: 39px;
  line-height: 1.18;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.best-block {
  padding-top: 11px;
}
.best-block b {
  display: block;
  font-size: 19px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.next-block {
  margin-left: auto;
  display: grid;
  grid-template-columns: 1fr 49px;
  grid-template-rows: 18px 21px;
  align-items: center;
  column-gap: 6px;
  max-width: 143px;
}
.next-block span {
  grid-area: 1/1;
}
.next-block b {
  grid-area: 2/1;
  color: #f7efce;
  font-size: 12px;
  font-weight: 400;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.next-block img {
  grid-area: 1/2/3/3;
  width: 49px;
  height: 49px;
  object-fit: contain;
}
.board-wrap {
  position: relative;
  width: 100%;
  border-radius: 22px;
  background: var(--ivory);
  box-shadow:
    0 20px 70px #001d2466,
    0 0 0 1px #e7cc8788,
    0 0 0 7px #5787771c;
  padding-top: 26px;
  overflow: hidden;
  color: var(--ink);
  isolation: isolate;
}
.board-top-label {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #81896c;
  z-index: 2;
  pointer-events: none;
}
.board-top-label span:last-child {
  font-size: 11px;
  letter-spacing: 0.06em;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 420/610;
  touch-action: none;
  user-select: none;
  outline: 0;
}
.first-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 43%;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.3s;
  color: #587762;
  font-size: 15px;
  letter-spacing: 0.08em;
}
.first-hint small {
  display: block;
  font-size: 12px;
  color: #889078;
  margin-top: 10px;
  letter-spacing: 0.05em;
}
.first-hint.hidden {
  opacity: 0;
}
.board-bottom {
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: #7c8569;
  background: #ede7cf;
  border-top: 1px solid #d1ccab;
}
.diamond {
  color: #a99a67;
  font-size: 7px;
}
.danger-label {
  position: absolute;
  right: 24px;
  top: 130px;
  color: #a64b38;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.danger-label.active {
  opacity: 1;
}
.toolbar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.tool {
  background: #27554d;
  border: 1px solid #527464;
  color: #e8efda;
  border-radius: 12px;
  min-height: 44px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  transition: background 0.15s;
}
.tool:hover {
  background: #386b5e;
}
.tool > span:first-child {
  font-size: 22px;
  color: #dac993;
  line-height: 1;
}
.tool > span:last-child:not(:first-child) {
  font-size: 12px;
}
.tool:first-child {
  flex: 1;
}
.icon-tool {
  padding: 0 12px;
}
.mobile-hint {
  font-size: 12px;
  color: #a9c0aa;
  text-align: center;
  margin: 14px 0 0;
  letter-spacing: 0.05em;
}
.collection-panel {
  align-self: center;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.17em;
  color: #9caf95;
}
.panel-title h2 {
  font-family: "Songti SC", SimSun, serif;
  font-size: 24px;
  letter-spacing: 0.1em;
  font-weight: 500;
  margin: 9px 0 0;
}
.panel-counter {
  font-family: Georgia, serif;
  border: 1px solid #68806b;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #e4cb8e;
}
.progression {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 10px;
  margin: 30px 0 35px;
}
.artifact-step {
  background: transparent;
  color: #cdd6bd;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.artifact-step .step-icon {
  border-radius: 50%;
  width: 62px;
  height: 62px;
  background: #214d45;
  border: 1px solid #5d795c;
  display: grid;
  place-items: center;
  position: relative;
  transition:
    background 0.15s,
    transform 0.15s;
}
.artifact-step:hover .step-icon {
  transform: translateY(-3px);
  background: #36624e;
}
.artifact-step img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.artifact-step .step-label {
  font-size: 12px;
  white-space: nowrap;
}
.artifact-step .step-no {
  position: absolute;
  right: -3px;
  bottom: -2px;
  font-size: 9px;
  color: #173f36;
  background: #c7b575;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 600;
}
.artifact-step.locked {
  opacity: 0.45;
}
.artifact-step.locked img {
  filter: brightness(0) invert(0.7);
  opacity: 0.27;
}
.artifact-step.locked .step-no {
  background: #71927c;
}
.learn-card {
  display: block;
  text-align: left;
  color: #eee8cd;
  background: linear-gradient(140deg, #2b584d, #1d473e);
  border: 1px solid #617e62;
  border-radius: 16px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 12px 35px #00282222;
}
.learn-card > div {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}
.learn-card img {
  width: 63px;
  height: 70px;
  object-fit: contain;
}
.learn-card h3 {
  font-size: 17px;
  margin: 0 0 6px;
  font-family: serif;
  font-weight: 500;
}
.learn-card div p {
  font-size: 12px;
  color: #a6c0ab;
  margin: 0;
}
.learn-card > p {
  font-size: 14px;
  line-height: 1.8;
  color: #bccfba;
  margin: 10px 0 16px;
}
.read-more {
  font-size: 12px;
  color: #e4c878;
}
.collection-note {
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: #9bb4a0;
  margin-top: 22px;
}
footer {
  grid-column: 1/-1;
  font-size: 12px;
  color: #8ba892;
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.04em;
}
.mobile-only {
  display: none;
}
dialog {
  border: 1px solid #c8b887;
  border-radius: 24px;
  padding: 0;
  max-width: min(480px, calc(100vw - 28px));
  width: 100%;
  color: #20433b;
  background: #fbf5e4;
  box-shadow: 0 25px 100px #001c2aaa;
  max-height: 90svh;
  overflow: auto;
  color-scheme: light;
}
dialog::backdrop {
  background: #082d2bd9;
  backdrop-filter: blur(6px);
}
.dialog-content {
  padding: 30px;
  position: relative;
  text-align: center;
}
.dialog-kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #a07b35;
  margin: 6px 0 12px;
}
.dialog-content h2 {
  font:
    600 28px/1.5 "Songti SC",
    SimSun,
    serif;
  margin: 4px 0 9px;
  letter-spacing: 0.08em;
}
.dialog-content p {
  font-size: 15px;
  line-height: 1.8;
  color: #617369;
  margin: 12px 0;
}
.artifact-hero {
  width: 160px;
  height: 160px;
  border: 1px solid #dfd2a8;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf3, #eee5c5);
  display: grid;
  place-items: center;
  margin: 20px auto;
  box-shadow: 0 0 0 8px #f4edd6;
}
.artifact-hero img {
  width: 140px;
  height: 140px;
  object-fit: contain;
}
.fact-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 16px;
}
.fact-meta span {
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid #d6cfb4;
  border-radius: 30px;
  color: #4c6554;
}
.source-link {
  color: #92713a;
  font-size: 12px;
  text-underline-offset: 3px;
  line-height: 1.8;
  display: inline-block;
  margin: 0 0 24px;
}
.primary-btn,
.secondary-btn {
  border-radius: 12px;
  min-height: 48px;
  font-size: 15px;
  width: 100%;
  padding: 12px 18px;
  transition: background 0.15s;
}
.primary-btn {
  background: #164c40;
  color: #fff4d2;
  box-shadow: 0 5px 10px #123d341a;
}
.primary-btn:hover {
  background: #22634f;
}
.secondary-btn {
  background: transparent;
  color: #4a6755;
  border: 1px solid #c5c9ad;
  margin-top: 10px;
}
.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #5c6c5b;
  font-size: 26px;
  line-height: 1;
}
.record-score {
  font:
    56px Georgia,
    serif;
  color: #af8134;
  line-height: 1.2;
  margin: 20px 0 5px;
}
.dialog-content .record-caption {
  font-size: 12px;
  color: #7d8975;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 25px 0;
}
.gallery-item {
  border: 1px solid #dfd6b9;
  border-radius: 12px;
  background: #f3edd9;
  min-height: 120px;
  padding: 9px 4px;
  color: #345541;
}
.gallery-item img {
  display: block;
  width: 65px;
  height: 70px;
  object-fit: contain;
  margin: auto;
}
.gallery-item b {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}
.gallery-item small {
  font-size: 10px;
  color: #929782;
}
.gallery-item.locked img {
  filter: brightness(0.1);
  opacity: 0.13;
}
.gallery-item.locked b {
  color: #919a8c;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  background: #f7edcd;
  color: #194738;
  padding: 12px 20px;
  border-radius: 30px;
  box-shadow: 0 6px 30px #001c2244;
  font-size: 14px;
  z-index: 10;
  transition: 0.2s;
  max-width: 90%;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.key-tips {
  border-top: 1px solid #d6cfb4;
  margin-top: 20px;
  padding-top: 15px;
  font-size: 12px;
  line-height: 1.9;
  color: #798473;
}
@media (min-width: 1200px) and (min-height: 950px) {
  .museum-game {
    padding-top: 60px;
    padding-bottom: 40px;
  }
}
@media (max-height: 850px) and (min-width: 901px) {
  .museum-game {
    grid-template-columns: minmax(180px, 1fr) minmax(300px, 350px) minmax(210px, 1fr);
    gap: 18px 38px;
    padding-top: 20px;
    padding-bottom: 14px;
    max-width: 1130px;
  }
  .scorebar {
    height: 68px;
  }
  .brand h1 {
    font-size: 37px;
  }
  .brand h1 span {
    font-size: 29px;
  }
  .desktop-intro {
    margin-top: 35px;
  }
  .progression {
    margin: 25px 0;
    gap: 12px 7px;
  }
  .artifact-step .step-icon {
    width: 55px;
    height: 55px;
  }
  .artifact-step img {
    width: 45px;
    height: 45px;
  }
  .learn-card {
    padding: 16px;
  }
  .toolbar {
    margin-top: 12px;
  }
  .mobile-hint {
    margin-top: 10px;
  }
}
@media (max-width: 1050px) {
  .museum-game {
    gap: 25px;
    padding-left: 26px;
    padding-right: 26px;
  }
  .brand h1 {
    font-size: 36px;
  }
  .brand h1 span {
    font-size: 28px;
  }
  .brand-kicker {
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .desktop-intro {
    margin-top: 38px;
  }
  .intro-rule {
    font-size: 12px;
  }
  .collection-panel {
    max-width: 250px;
  }
}
@media (max-width: 900px) {
  .museum-game {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 480px;
    padding: 20px 18px 18px;
    align-items: stretch;
  }
  .brand {
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .brand-kicker {
    font-size: 0;
    gap: 0;
  }
  .seal {
    width: 31px;
    height: 35px;
    font-size: 22px;
  }
  .brand h1 {
    display: flex;
    gap: 10px;
    font-size: 23px;
    letter-spacing: 0.06em;
    margin: 0 0 0 10px;
    line-height: 1.5;
    align-items: baseline;
    flex: 1;
  }
  .brand h1 span {
    font-size: 18px;
    letter-spacing: 0.08em;
  }
  .brand-note,
  .desktop-intro,
  .collection-panel {
    display: none;
  }
  .scorebar {
    height: 75px;
    padding: 8px 5px 12px;
    gap: 26px;
  }
  .score-primary strong {
    font-size: 34px;
  }
  .best-block {
    padding-top: 7px;
  }
  .next-block {
    grid-template-columns: 1fr 45px;
  }
  .next-block img {
    width: 45px;
    height: 45px;
  }
  .board-wrap {
    border-radius: 19px;
    padding-top: 22px;
  }
  .board-top-label {
    top: 10px;
    font-size: 8px;
  }
  .toolbar {
    margin-top: 13px;
    gap: 7px;
  }
  .tool {
    min-height: 43px;
    padding: 0 11px;
  }
  .mobile-hint {
    font-size: 11px;
    margin-top: 11px;
  }
  footer {
    margin-top: 18px;
    font-size: 10px;
    opacity: 0.85;
  }
  .mobile-only {
    display: block;
  }
  .dialog-content {
    padding: 27px 22px;
  }
  .dialog-content h2 {
    font-size: 25px;
  }
  .artifact-hero {
    width: 143px;
    height: 143px;
  }
  .artifact-hero img {
    width: 125px;
    height: 125px;
  }
}
@media (max-width: 390px) {
  .museum-game {
    padding: 15px 13px;
  }
  .brand h1 {
    font-size: 20px;
    gap: 8px;
  }
  .brand h1 span {
    font-size: 16px;
  }
  .scorebar {
    height: 68px;
  }
  .scorebar span {
    font-size: 11px;
  }
  .next-block b {
    font-size: 11px;
  }
  .toolbar {
    gap: 6px;
  }
  .tool {
    font-size: 13px;
    padding: 0 10px;
  }
  .tool > span:last-child:not(:first-child) {
    font-size: 11px;
  }
  footer {
    margin-top: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (min-width: 500px) and (max-width: 900px) {
  .museum-game {
    padding-top: 26px;
  }
  .brand h1 {
    font-size: 26px;
  }
}
@media (max-height: 760px) and (max-width: 500px) {
  .museum-game {
    max-width: 365px;
    padding-top: 12px;
  }
  .brand h1 {
    font-size: 20px;
  }
  .brand h1 span {
    font-size: 16px;
  }
  .seal {
    width: 28px;
    height: 30px;
    font-size: 19px;
  }
  .scorebar {
    height: 62px;
  }
  .score-primary strong {
    font-size: 30px;
  }
  .toolbar {
    margin-top: 10px;
  }
  .mobile-hint {
    margin-top: 9px;
  }
  footer {
    margin-top: 10px;
  }
}

.unlock-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 8;
  width: 340px;
  max-width: calc(100vw - 24px);
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  gap: 9px;
  padding: 14px;
  border: 1px solid #d7bf7c;
  border-radius: 15px;
  background: #fcf5df;
  color: #244f40;
  box-shadow: 0 8px 32px #082d2b44;
  animation: notice-enter 0.24s ease-out;
}
.unlock-notice[hidden] {
  display: none;
}
.unlock-notice > img {
  width: 48px;
  height: 56px;
  object-fit: contain;
  align-self: center;
}
.unlock-notice button {
  background: transparent;
  text-align: left;
  padding: 0;
  color: inherit;
}
.unlock-notice strong {
  display: block;
  font-size: 14px;
  color: #305542;
}
.unlock-notice span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.65;
  color: #68705a;
}
.unlock-notice small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: #92783e;
}
.unlock-notice #unlock-dismiss {
  font-size: 23px;
  align-self: start;
  text-align: center;
  min-height: 30px;
}
.unlock-notice #unlock-open {
  min-width: 0;
}
@keyframes notice-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 900px) {
  .unlock-notice {
    top: max(10px, env(safe-area-inset-top));
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 365px;
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .unlock-notice {
    animation: none !important;
  }
}
