:root {
  color-scheme: light;
  --ink: #183f34;
  --soft: #476253;
  --paper: #f8f3e7;
  --sheet: #fffdf5;
  --rule: #b1b9a0;
  --red: #a5392e;
  --snow: #e8eddf;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 80% 0%, #e7ebd6 0, transparent 35rem);
}
button,
input {
  font: inherit;
}
a {
  color: inherit;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #b63d2c;
  outline-offset: 3px;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
.mast {
  max-width: 75rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font:
    700 1.24rem "Songti SC",
    "SimSun",
    serif;
  text-decoration: none;
}
.return {
  font-size: 0.9rem;
  text-underline-offset: 0.27em;
  font-weight: 600;
}
main {
  width: min(100% - 2rem, 60rem);
  margin: 2rem auto 3rem;
}
.intro {
  margin-bottom: 1.6rem;
}
h1,
h2,
.ready-title,
.result-title {
  font-family: "Songti SC", "STSong", "SimSun", Georgia, serif;
}
h1 {
  font-size: clamp(2.15rem, 6vw, 3.65rem);
  line-height: 1.15;
  letter-spacing: 0.025em;
  margin: 0 0 0.65rem;
}
.intro p,
#rules {
  color: var(--soft);
  margin: 0;
  line-height: 1.6;
}
#choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.4rem;
  font-weight: 650;
  font-size: 0.96rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  color: var(--ink);
  background: var(--sheet);
}
.choice[aria-current="true"] {
  color: #fffdf5;
  background: var(--ink);
  border-color: var(--ink);
}
.choice svg {
  width: 1.8rem;
  height: 1.8rem;
  flex-shrink: 0;
}
.desk {
  background: var(--sheet);
  border: 1px solid #99a88f;
  border-top: 0.38rem solid var(--ink);
  border-radius: 0.5rem;
  padding: clamp(0.85rem, 3vw, 1.85rem);
  box-shadow: 0 4px 0 #dae0ca;
}
.desk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}
#rules {
  font-size: 0.92rem;
  max-width: 38rem;
}
.tallies {
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.9rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tallies div {
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
}
.tallies dt {
  font-size: 0.82rem;
  color: var(--soft);
  white-space: nowrap;
}
.tallies dd {
  font:
    700 1.55rem Georgia,
    serif;
  margin: 0.12rem 0 0;
}
.challenge {
  font-size: 0.9rem;
  background: #fce8d5;
  color: #754226;
  padding: 0.6rem 0.85rem;
  border-radius: 0.35rem;
}
#arena {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 18.5rem;
  padding: 1rem;
  border: 1px dashed #96a58c;
  border-radius: 0.4rem;
  background: linear-gradient(150deg, #ecf0df, #f6f3e8);
}
.ready,
.result {
  text-align: center;
}
.ready svg,
.result svg {
  width: 4.5rem;
  height: 4.5rem;
  padding: 0.75rem;
  color: #fff9e8;
  background: var(--ink);
  border-radius: 50%;
}
.result svg {
  background: var(--red);
}
.ready-title,
.result-title {
  margin: 0.6rem 0 0.35rem;
  font-weight: 700;
  font-size: 1.6rem;
}
.ready p:last-child,
.result p:last-child {
  margin: 0;
  color: var(--soft);
}
.actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn {
  min-height: 2.85rem;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--ink);
  border-radius: 0.38rem;
  font-weight: 650;
}
.primary {
  color: white;
  background: var(--ink);
}
.secondary {
  background: transparent;
  color: var(--ink);
}
.notice {
  margin: 0.65rem 0 0;
  color: var(--soft);
  font-size: 0.9rem;
}
.notice:empty {
  display: none;
}
#manual-share {
  margin-top: 0.8rem;
}
#manual-share label {
  display: block;
  margin-bottom: 0.35rem;
}
#manual-share input,
.word-entry {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  color: var(--ink);
  background: #fffef9;
}
.game-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  margin: 0 0 0.65rem;
  font-weight: 600;
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}
.game-line output {
  white-space: nowrap;
  color: var(--red);
}
.catch,
.target-wrap,
.matches,
.word {
  width: min(100%, 24rem);
}
#arena:has(.catch),
#arena:has(.target-wrap),
#arena:has(.matches),
#arena:has(.word) {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}
.field {
  display: grid;
  position: relative;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 13rem;
  border: 1px solid #abb69d;
  border-radius: 0.35rem;
  overflow: hidden;
  background: linear-gradient(#e0e9da, #f8f5df);
}
.lane {
  position: relative;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
}
.lane + .lane {
  border-left: 1px dashed #b0beaa;
}
.lane:focus-visible {
  z-index: 1;
  outline-offset: -4px;
}
.parcel,
.sled {
  position: absolute;
  left: 50%;
  width: 2.15rem;
  height: 2.15rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.parcel[data-row="0"] {
  top: 0.35rem;
}
.parcel[data-row="1"] {
  top: 20%;
}
.parcel[data-row="2"] {
  top: 40%;
}
.parcel[data-row="3"] {
  top: 60%;
}
.parcel.good {
  color: var(--red);
}
.parcel.ice {
  color: #3e6b75;
}
.sled {
  bottom: 0;
  width: 2.75rem;
  height: 2.75rem;
}
.target-grid,
.match-grid {
  display: grid;
  gap: 0.4rem;
}
.target-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.match-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tile {
  border-radius: 0.38rem;
  border: 1px solid #9bab90;
  min-height: 3.1rem;
  padding: 0.25rem;
  display: grid;
  place-content: center;
  background: #f6f4e5;
  color: var(--ink);
}
.tile svg {
  width: 2rem;
  height: 2rem;
}
.target {
  position: relative;
}
.target::after {
  content: attr(data-key);
  position: absolute;
  bottom: 0.16rem;
  right: 0.27rem;
  font:
    700 0.76rem Georgia,
    serif;
  opacity: 0.75;
}
.target.hot,
.tile.face {
  color: #fff8e6;
  background: var(--red);
}
.tile.cover {
  background: var(--ink);
  color: #d8ddba;
}
.tile.paired {
  background: #d8e6cd;
  border-color: #879b7b;
}
.word {
  text-align: center;
}
.word label {
  display: block;
  text-align: left;
  font-size: 0.9rem;
  margin: 0.65rem 0 0.3rem;
}
.clue {
  margin: 0.5rem 0;
  font-weight: 650;
}
.letters {
  font:
    700 clamp(1.6rem, 6vw, 2.5rem) Georgia,
    serif;
  letter-spacing: 0.12em;
  color: var(--red);
  word-break: break-word;
  margin: 0.6rem 0;
}
.word-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.feedback {
  margin: 0.4rem 0 0;
  color: var(--red);
  min-height: 1.35rem;
  font-size: 0.9rem;
}
@media (max-width: 40rem) {
  main {
    margin-top: 1.4rem;
  }
  #choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .choice {
    min-height: 2.85rem;
  }
  .desk-head {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  .tallies {
    gap: 0.9rem;
  }
  .tallies div {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding-left: 0;
    border: none;
  }
  .tallies dd {
    font-size: 1.15rem;
  }
  #arena {
    min-height: 15rem;
    padding: 0.65rem;
  }
}
