* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #f1f3e8;
  color: #172619;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei",
    sans-serif;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #608530;
  outline-offset: 4px;
}
a {
  color: inherit;
}
button {
  border: 0;
}
button[hidden],
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 30;
  background: #d1fa68;
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: auto;
  padding: 0 40px;
  border-bottom: 1px solid #ced6c6;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 1px;
  font-size: 17px;
}
.wordmark > span:first-child {
  background: #243320;
  color: #d1fa68;
  padding: 5px 8px;
  border-radius: 8px;
  margin-right: 7px;
}
.wordmark .thin {
  font-weight: 400;
}
.wordmark small {
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 400;
  margin-left: 10px;
  color: #58664c;
}
.topbar nav {
  display: flex;
  gap: 25px;
  align-items: center;
  font-size: 13px;
}
.topbar nav a {
  text-decoration: none;
}
.topbar nav button {
  background: none;
  color: inherit;
  padding: 12px 0;
}
.workspace {
  max-width: 1120px;
  margin: 46px auto 38px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 440px);
  gap: 96px;
  padding: 0 42px;
  align-items: start;
}
.intro {
  padding-top: 22px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font:
    10px ui-monospace,
    SFMono-Regular,
    monospace;
  letter-spacing: 2px;
  color: #65744e;
}
.eyebrow > span {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #708e34;
}
h1 {
  font-family: "Songti TC", "Noto Serif TC", Georgia, serif;
  font-size: 55px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -2px;
  margin: 26px 0 20px;
}
h1 span {
  position: relative;
  z-index: 0;
}
h1 span::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -9px;
  bottom: 3px;
  height: 19px;
  background: #d1fa68;
  z-index: -1;
  transform: rotate(-3deg);
}
.lead {
  color: #65715a;
  font-size: 15px;
  line-height: 1.95;
  margin: 0 0 26px;
}
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 20px 0;
  margin: 0 0 21px;
  border-top: 1px solid #cdd5c4;
  border-bottom: 1px solid #cdd5c4;
}
.summary strong {
  display: block;
  font:
    500 32px ui-monospace,
    SFMono-Regular,
    monospace;
  letter-spacing: -1px;
}
.summary strong span {
  font-size: 14px;
  color: #7d8970;
  margin-left: 2px;
}
.summary small {
  display: block;
  font-size: 11px;
  color: #65715a;
  margin-top: 5px;
}
.primary {
  background: #243b20;
  color: #eff8de;
  min-height: 48px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
}
.primary:hover {
  background: #35512b;
}
#daily-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.micro {
  text-align: center;
  color: #6f7c61;
  font-size: 11px;
  margin: 12px 0 26px;
  letter-spacing: 1px;
}
.catalog {
  border-top: 1px solid #cdd5c4;
}
.catalog summary {
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.catalog summary::-webkit-details-marker {
  display: none;
}
.catalog summary span {
  font-size: 10px;
  color: #77856b;
  font-weight: 400;
}
.search-label {
  position: absolute;
  clip: rect(0, 0, 0, 0);
}
#game-search {
  width: 100%;
  border: 1px solid #c9d2bd;
  background: #ffffff60;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12px;
  color: #213319;
  margin: 0 0 9px;
  min-height: 42px;
}
.game-list {
  max-height: 365px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b4c1a0 transparent;
  padding-right: 5px;
}
.game-choice {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  padding: 11px 8px;
  background: none;
  border-bottom: 1px solid #dae0d1;
  color: #283921;
  min-height: 55px;
}
.game-choice:hover,
.game-choice[aria-current="true"] {
  background: #e2eccf;
  border-radius: 8px;
}
.game-number {
  font:
    10px ui-monospace,
    monospace;
  color: #8a987a;
}
.game-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  font-size: 13px;
}
.game-label small {
  font-size: 10px;
  color: #798a68;
}
.game-choice > span:last-child {
  font-size: 13px;
  color: #7a8e62;
}
#no-results {
  font-size: 12px;
  color: #6e7d60;
  padding: 12px 0;
}
.save-tools {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: 24px;
  color: #758269;
  font-size: 11px;
}
.save-tools button {
  padding: 8px 0;
  background: none;
  color: #526649;
  min-height: 36px;
}
.storage-note {
  font-size: 10px;
  line-height: 1.75;
  color: #849078;
  margin: 3px 0;
}
.play-area {
  position: sticky;
  top: 20px;
  min-width: 0;
  max-width: max(320px, min(440px, calc((100svh - 82px) * 0.4620853)));
  justify-self: end;
}
.stage-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  color: #819074;
  margin: 0 3px 13px;
}
.online-dot {
  font: 10px sans-serif;
  letter-spacing: 0;
  display: flex;
  gap: 5px;
  align-items: center;
}
.online-dot::before {
  content: "";
  height: 5px;
  width: 5px;
  background: #80a544;
  border-radius: 100%;
}
.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 844;
  background: #101611;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 24px 60px #263b1723;
  border: 1px solid #344135;
  scroll-margin-top: 18px;
  outline: none;
}
.game-stage:focus-visible {
  outline: 3px solid #758f49;
  outline-offset: 5px;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.game-controls {
  position: absolute;
  inset: 0;
}
.game-controls button {
  position: absolute;
  background: transparent;
  color: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-size: 1px;
  border-radius: 10px;
  touch-action: manipulation;
}
.game-controls button:focus-visible {
  outline: 3px solid #f1ffde;
  outline-offset: -3px;
  background: #ffffff12;
}
.play-note {
  text-align: center;
  font-size: 10px;
  color: #85917b;
  margin: 17px 0 0;
}
.storage-warning {
  background: #fff0c8;
  color: #62480b;
  border: 1px solid #e1cc85;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.page-footer {
  max-width: 1200px;
  margin: 35px auto 0;
  border-top: 1px solid #cdd5c4;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 10px;
  color: #819173;
}
.page-footer span:first-child {
  flex: 1;
}
.page-footer a {
  text-decoration: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
dialog {
  border: 1px solid #d0d9c7;
  border-radius: 22px;
  background: #f6f8ef;
  color: #22311c;
  padding: 28px;
  width: 430px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 25px 80px #0003;
}
dialog::backdrop {
  background: #0c170caf;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 23px;
  margin: 6px 0 18px;
}
dialog p {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
}
dialog label {
  display: block;
  font-size: 11px;
  color: #79896c;
  margin: 20px 0 8px;
}
dialog input {
  width: 100%;
  padding: 13px;
  border: 1px solid #ccd6c0;
  border-radius: 9px;
  background: #fff;
  color: #3a4b2c;
  font-size: 12px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.dialog-actions button {
  min-height: 44px;
  border-radius: 10px;
  padding: 12px 17px;
  background: #e6ecd9;
  color: #2e4122;
}
.dialog-actions .primary {
  background: #294821;
  color: #f4f9e8;
}
#share-status {
  font-size: 12px;
  margin-bottom: 0;
  color: #617447;
}
@media (min-width: 1400px) {
  .workspace {
    max-width: 1180px;
    gap: 130px;
  }
  h1 {
    font-size: 62px;
  }
}
@media (max-width: 900px) {
  .workspace {
    gap: 36px;
    padding: 0 24px;
    grid-template-columns: minmax(245px, 1fr) minmax(330px, 1fr);
  }
  h1 {
    font-size: 43px;
  }
  .topbar {
    padding: 0 24px;
  }
  .wordmark small {
    display: none;
  }
  .game-stage {
    border-radius: 20px;
  }
}
@media (max-width: 680px) {
  .topbar {
    height: 62px;
    padding: 0 18px;
  }
  .wordmark {
    font-size: 14px;
  }
  .topbar nav {
    gap: 16px;
    font-size: 11px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    margin: 24px auto 20px;
    gap: 24px;
    padding: 0 18px;
    max-width: 470px;
  }
  .intro {
    width: 100%;
    padding-top: 0;
  }
  .eyebrow {
    font-size: 8px;
    margin-top: 0;
  }
  h1 {
    font-size: 34px;
    letter-spacing: -1px;
    margin: 16px 0 12px;
    line-height: 1.25;
  }
  h1 br {
    display: none;
  }
  .lead {
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 18px;
  }
  .lead br {
    display: none;
  }
  .summary {
    padding: 13px 0;
    margin-bottom: 16px;
  }
  .summary strong {
    font-size: 25px;
  }
  .summary small {
    font-size: 10px;
  }
  #daily-button {
    min-height: 46px;
    padding: 12px 16px;
    font-size: 13px;
  }
  .micro {
    margin: 10px 0 14px;
    font-size: 10px;
  }
  .catalog summary {
    padding: 14px 0;
    font-size: 13px;
  }
  .game-list {
    max-height: 300px;
  }
  .save-tools {
    margin-top: 12px;
    font-size: 10px;
    gap: 14px;
  }
  .storage-note {
    display: none;
  }
  .play-area {
    position: static;
    width: 100%;
    max-width: none;
  }
  .game-stage {
    border-radius: 18px;
  }
  .stage-label {
    font-size: 8px;
  }
  .page-footer {
    padding: 20px 18px;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 9px;
    margin-top: 12px;
  }
  .page-footer span:first-child {
    flex-basis: 100%;
  }
  .page-footer span:last-child {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}
