:root {
  color-scheme: light;
  --ink: #1d3f34;
  --muted: #4d695a;
  --deep: #214e40;
  --deeper: #183e32;
  --edge: #cedacf;
  --cream: #fcfbef;
  --gutter: clamp(12px, 3.6vw, 58px);
  --header-h: clamp(52px, 8.5dvh, 74px);
  --footer-h: 29px;
  --header-gap: clamp(10px, 2.1dvh, 20px);
  --paper: #eff3e8;
  --label: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --display: "STSong", "Songti SC", SimSun, "Noto Serif CJK SC", serif;
  font: 16px/1.45 var(--label);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h);
  color: var(--ink);
  background: radial-gradient(ellipse at 15% 0%, #fcfbeb, transparent 56%),
              radial-gradient(ellipse at 100% 100%, #dcebe0, transparent 63%), #edf1e6;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #377c5c; outline-offset: 3px; }
.frame { width: min(1184px, calc(100% - 2 * var(--gutter))); margin-inline: auto; min-width: 0; }
.site-header { border-bottom: 1px solid #d8e2d4; background: #fbfcf25c; }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--deep);
  text-decoration: none;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.wordmark img { display: block; width: 39px; height: 39px; }
.wordmark-en {
  display: block;
  font-family: Georgia, serif;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .07em;
  margin-top: 3px;
}
.header-actions { display: flex; gap: 7px; }
.quiet-button, .tool-button, .direction, .close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #f8faef;
  min-height: 36px;
  padding: 3px 11px;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}
.quiet-button { background: #f9faf280; }
.quiet-button:hover, .tool-button:not(:disabled):hover, .direction:not(:disabled):hover, .close-button:hover { background: #e5eddb; }
.sound-button[aria-pressed="true"] { background: #e5eddb; }
.glyph { display: inline-block; width: 14px; height: 14px; flex: none; }
.glyph-book {
  border: 1.5px solid currentColor;
  border-radius: 2px 3px 3px 2px;
  background: linear-gradient(90deg, transparent 26%, currentColor 26% 37%, transparent 37%);
  width: 12px;
}
.glyph-help { border: 1.5px solid currentColor; border-radius: 50%; font: 800 10px/11px var(--label); }
.glyph-note { font: 800 1.1rem/.9 var(--label); }
.glyph-calendar { border: 1.5px solid currentColor; border-radius: 3px; box-shadow: inset 0 3px currentColor; }
.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.01fr);
  gap: clamp(22px, 4vw, 61px);
  align-content: center;
  align-items: stretch;
  padding-block: var(--header-gap);
  min-height: 0;
}
.welcome { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2dvh, 19px); }
.introduction h1 {
  font: 800 clamp(3.25rem, min(6.8vw, 9dvh), 6.1rem)/1.01 var(--display);
  letter-spacing: -.075em;
  margin: 0 0 9px;
}
.introduction p { margin: 0; font-size: clamp(.91rem, 1.6vw, 1.14rem); color: var(--muted); }
.valley-postcard {
  position: relative;
  margin: 0;
  border: 1px solid #bbcdba;
  aspect-ratio: 1.52;
  height: clamp(115px, calc(100dvh - 350px), 360px);
  width: 100%;
  overflow: hidden;
  border-radius: 21px;
  isolation: isolate;
  background: #a6c9ab;
  box-shadow: 0 10px 30px #24483618;
}
.valley-postcard img { display: block; width: 100%; height: 100%; object-fit: cover; }
.valley-postcard figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  padding: 29px 16px 12px;
  background: linear-gradient(transparent, #163e2dc9);
  color: #fffcee;
}
.postcard-caption { font-family: var(--display); font-weight: 800; font-size: 1.14rem; }
.postcard-count { font-size: .875rem; }
.field-notes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #f8faf0;
  border: 1px solid var(--edge);
  border-radius: 13px;
}
.field-notes:hover { background: #f2f6e8; }
.collection-trail { display: flex; flex: 1; gap: clamp(3px, .48vw, 5px); min-width: 0; }
.stamp {
  display: grid;
  place-items: center;
  flex: 1 1 33px;
  min-width: 0;
  max-width: 33px;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e6edde;
  border-radius: 7px;
  color: #718675;
  font-size: .82rem;
}
.stamp img { width: 90%; height: 90%; object-fit: contain; }
.collection-label { font-size: .875rem; font-weight: 750; white-space: nowrap; }

.play-card {
  --panel-padding: clamp(10px, 2.2dvh, 19px);
  --play-gap: clamp(6px, 1.3dvh, 12px);
  width: 100%;
  min-width: 0;
  max-width: 522px;
  justify-self: center;
  display: grid;
  justify-items: stretch;
  align-content: center;
  gap: var(--play-gap);
  padding: var(--panel-padding);
  border: 1px solid #d0dcd0;
  border-radius: 22px;
  background: #fafbf2;
  box-shadow: 0 15px 35px #1e49351a, inset 0 1px 0 #fff;
}
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; background: #e9efe3; border-radius: 11px; }
.mode {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 750;
  white-space: nowrap;
}
.mode[aria-pressed="true"] { color: #265444; background: #fdfdf3; box-shadow: 0 1px 4px #24453418; }
.mode:not([aria-pressed="true"]):hover { background: #dce8d8; }
.mode-symbol { font-size: 1rem; line-height: 1; }
.scorebar { display: grid; grid-template-columns: 1fr 1fr auto; gap: clamp(5px, 1.1vw, 9px); }
.score-tile {
  min-width: 0;
  position: relative;
  display: grid;
  align-content: center;
  border: 1px solid #dce5d8;
  border-radius: 10px;
  padding: 5px 10px;
  background: #edf3e8;
}
.score-best { background: #f3f1de; border-color: #e8e4cc; }
.score-caption { color: var(--muted); font-size: .79rem; white-space: nowrap; line-height: 1.2; }
.score-tile output { font: 800 clamp(1.24rem, 3.3dvh, 1.65rem)/1.16 var(--label); font-variant-numeric: tabular-nums; }
.score-gain { position: absolute; right: 8px; bottom: 9px; color: #27614b; font-size: .82rem; font-weight: 850; pointer-events: none; }
.score-gain.float { animation: float-away .68s ease-out both; }
@keyframes float-away { to { transform: translateY(-24px); opacity: 0; } }
.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px clamp(8px, 1.2vw, 15px);
  border: 1px solid var(--deeper);
  border-radius: 10px;
  background: linear-gradient(155deg, #315f4b, #214e40);
  color: #fffbed;
  font-size: .875rem;
  font-weight: 750;
  white-space: nowrap;
}
.solid-button:hover { background: #367259; }
.restart-symbol { font-size: 1.13rem; line-height: 1; }
.board {
  width: var(--board-side);
  aspect-ratio: 1;
  justify-self: center;
  align-self: center;
  position: relative;
  padding: clamp(5px, 1.35vmin, 11px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #c6d8c5;
  border-radius: clamp(12px, 2.3vmin, 20px);
  background: linear-gradient(155deg, #cedecc, #bccfbc);
  box-shadow: inset 0 1px 1px #506d4824;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  --slot-gap: 2.2%;
  --slot-size: 23.35%;
}
.board-slots {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  column-gap: var(--slot-gap);
  row-gap: var(--slot-gap);
}
.board-slots i { background: #edf3e780; border-radius: clamp(5px, 1.45vmin, 12px); box-shadow: inset 0 1px 1px #4e6a4921; }
.board-tiles { position: absolute; inset: clamp(5px, 1.35vmin, 11px); pointer-events: none; }
.milestone {
  position: absolute;
  z-index: 1;
  inset: clamp(6px, 1.5vmin, 12px) 0 auto;
  width: min(284px, calc(100% - 14px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 9px 6px 7px;
  border: 1px solid var(--tier-edge, #b5c8a8);
  border-radius: 13px;
  background: #fffdf3;
  box-shadow: 0 6px 16px #16392d3b;
  pointer-events: none;
  animation: milestone-in .22s ease-out both;
}
.milestone img {
  width: clamp(26px, 9cqw, 43px);
  height: auto;
  padding: 3px;
  border-radius: 8px;
  background: var(--tile, #edf3e8);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.milestone-copy { display: grid; gap: 2px; line-height: 1.2; }
.milestone-copy strong { font-size: .875rem; }
.milestone-copy span { color: var(--muted); font-size: .74rem; }
.milestone-spark { color: #8a6928; font-size: 1.15rem; }
@keyframes milestone-in { from { opacity: 0; transform: translateY(-7px); } }
.tile {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--slot-size);
  height: var(--slot-size);
  display: grid;
  place-items: stretch;
  transform: translate(calc(var(--col) * 109.42184%), calc(var(--row) * 109.42184%));
  transition: transform 128ms cubic-bezier(.2, .72, .24, 1);
}
.tile-face {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 1px;
  padding: 4% 6% 5%;
  border: 1px solid var(--tier-edge, #345b341e);
  border-radius: clamp(5px, 1.45vmin, 12px);
  box-shadow: 0 2px 5px #263d2e1c, inset 0 1px 0 #fff9, var(--tier-glow, 0 0 0 transparent);
  background: var(--tile, #f3edcd);
  color: #244135;
}
.tile-image {
  width: min(95%, 85px);
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transform: scale(var(--art-scale, 1));
}
.tile-number { font-weight: 850; font-size: clamp(.69rem, 2.25vmin, 1.04rem); line-height: 1; font-variant-numeric: tabular-nums; }
[data-level="0"] { --tile: #f6efd7; --art-scale: .70; }
[data-level="1"] { --tile: #e2ecc2; --art-scale: .76; }
[data-level="2"] { --tile: #d4e7aa; --art-scale: .81; }
[data-level="3"] { --tile: #fdeab0; --art-scale: .85; }
[data-level="4"] { --tile: #f6d6bf; --art-scale: .89; }
[data-level="5"] { --tile: #d7e7c2; --art-scale: .92; }
[data-level="6"] { --tile: #bedccd; --art-scale: .95; }
[data-level="7"] { --tile: #b9ddd9; --art-scale: .97; }
[data-level="8"] { --tile: #efdebc; --art-scale: .99; }
[data-level="9"] {
  --tile: linear-gradient(155deg, #fdf0fc, #e1d1ed);
  --tier-edge: #b49ecb;
}
[data-level="10"] {
  --tile: linear-gradient(155deg, #edfbff, #c1dfec);
  --tier-edge: #86adc6;
  --tier-glow: inset 0 0 0 2px #f6fdff89;
}
[data-level="11"] {
  --tile: radial-gradient(ellipse at top, #fffbd1, transparent 76%), linear-gradient(150deg, #def5cc, #a7d9c5);
  --tier-edge: #739d76;
  --tier-glow: inset 0 0 0 2px #fff9ba94, 0 0 10px #f9eca996;
}
.tile.new .tile-face { animation: appear .22s ease-out both; }
.tile.bloom .tile-face { animation: bloom .3s cubic-bezier(.22,.8,.24,1.24) both; }
@keyframes appear { from { transform: scale(.5); opacity: .4; } }
@keyframes bloom { 40% { transform: scale(1.15); box-shadow: 0 0 13px #f8dc72ac; } }
.game-tools, .tool-group, .direction-pad { display: flex; gap: 5px; align-items: center; }
.game-tools { justify-content: space-between; }
.tool-button { padding-inline: clamp(6px, 1.1vw, 10px); }
.tool-button span { font-size: 1.05rem; line-height: 1; }
.tool-button .hint-count {
  display: inline-grid;
  min-width: 1.22rem;
  height: 1.22rem;
  place-items: center;
  border-radius: 50%;
  background: #e0ecd3;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  font-size: .75rem;
}
.direction { padding: 3px 6px; min-width: 36px; font-size: 1.02rem; line-height: 1; }
.direction.suggested { background: #e1eccc; box-shadow: inset 0 0 0 1px #8ca076; }
.progress-card {
  display: grid;
  grid-template-columns: auto auto minmax(62px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 9px;
  border-radius: 10px;
  background: #e9efe1;
}
.progress-card.achieved { background: #e8f0d5; box-shadow: inset 0 0 0 1px #bbc798; }
.progress-card.achieved .goal-text span { color: #325735; font-weight: 800; }
.goal-picture { width: 33px; height: 33px; display: grid; place-items: center; }
.goal-picture img { width: 100%; height: 100%; object-fit: contain; }
.goal-text, .goal-meter { display: grid; min-width: 0; }
.goal-text span, .goal-meter span { color: var(--muted); font-size: .75rem; line-height: 1.2; }
.goal-text strong { font-size: .88rem; white-space: nowrap; }
.goal-meter { justify-items: end; gap: 4px; align-content: center; }
.goal-meter progress { display: block; width: min(100%, 143px); height: 5px; border: 0; border-radius: 20px; background: #cadcc9; }
progress::-webkit-progress-bar { background: #cadcc9; border-radius: 20px; }
progress::-webkit-progress-value { background: #557f51; border-radius: 20px; transition: width .22s ease; }
progress::-moz-progress-bar { background: #557f51; border-radius: 20px; }
.game-instructions {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(.72rem, 1.6dvh, .84rem);
  line-height: 1.2;
  text-align: center;
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .75rem;
  border-top: 1px solid #d8e2d4;
}
.daily-date:empty { display: none; }
.sheet {
  width: min(460px, calc(100vw - 26px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(15px, 3.4vmin, 27px);
  color: var(--ink);
  border: 1px solid #c4d5c6;
  border-radius: 18px;
  background: #fbfcf3;
  box-shadow: 0 20px 55px #123b2e48;
}
.sheet::backdrop { background: #133a2a88; }
.sheet-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.sheet-heading h2 { font: 800 clamp(1.5rem, 5vmin, 2rem)/1.12 var(--display); margin: 0; }
.sheet-heading p, #dialog-text { margin: 8px 0 14px; color: var(--muted); }
.close-button { font-size: 1.36rem; width: 36px; padding: 0; line-height: 1; }
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.8vmin, 10px);
  padding: 0;
  margin: 0;
  list-style: none;
}
.book-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 7px 3px;
  text-align: center;
  border: 1px solid #dbe5d9;
  border-radius: 10px;
  background: var(--tile, #edf1e7);
  font-size: .86rem;
  line-height: 1.2;
}
.book-item img, .book-locked { width: min(50px, 12vmin); height: min(50px, 12vmin); object-fit: contain; }
.book-locked { display: grid; place-items: center; color: #5b7160; font: 700 1.25rem/1 var(--display); }
.book-item.locked { background: #eff2e9; color: #4a6252; }
.book-item small { color: #4b6555; font-size: .76rem; }
.help-list { padding-left: 1.25em; margin: 13px 0; color: var(--muted); }
.help-list li + li { margin-top: 7px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sheet.victory {
  border-color: #a9bd95;
  background: radial-gradient(ellipse at 50% 0%, #efefcb, transparent 62%), #fbfcf3;
  text-align: center;
}
.victory .sheet-heading, .victory .sheet-actions { justify-content: center; }
.victory-picture {
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3.5vmin, 22px);
  height: clamp(82px, 29dvh, 172px);
  margin-bottom: 10px;
  color: #8b6b25;
  font-size: clamp(1.2rem, 6vmin, 2.25rem);
  background: radial-gradient(ellipse, #fffbcd, transparent 62%);
  animation: victory-in .4s ease-out;
}
.victory-picture img { width: auto; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.victory-picture span:first-child { align-self: end; }
.victory-picture span:last-child { align-self: start; }
@keyframes victory-in { from { opacity: 0; transform: scale(.9); } }
@media (max-height: 415px) and (orientation: landscape) {
  .book-sheet { width: min(542px, calc(100vw - 26px)); }
  .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .book-item { padding-block: 4px; font-size: .79rem; }
  .book-item img, .book-locked { width: min(36px, 10vmin); height: min(36px, 10vmin); }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.noscript { position: fixed; inset: auto 0 0; margin: 0; padding: 10px; text-align: center; background: #fdf4d9; }

@media (max-width: 706px) and (orientation: portrait) {
  :root { --header-h: 52px; --footer-h: 20px; --header-gap: 8px; --gutter: clamp(8px, 3vw, 22px); }
  .frame { width: min(550px, calc(100% - 2 * var(--gutter))); }
  .play { grid-template-columns: minmax(0, 1fr); gap: 7px; align-items: center; }
  .welcome { display: block; }
  .introduction { text-align: center; }
  .introduction h1 { font-size: clamp(1.9rem, 6.2dvh, 3.15rem); margin-bottom: 4px; }
  .introduction p { font-size: .86rem; }
  .valley-postcard, .field-notes { display: none; }
  .play-card { --panel-padding: 9px; --play-gap: 7px; max-width: 478px; border-radius: 16px; }
  .site-footer { justify-content: center; border: 0; font-size: .72rem; }
}
@media (max-width: 374px) {
  .header-actions { gap: 4px; }
  .quiet-button { padding-inline: 6px; }
  .wordmark { gap: 6px; }
  .wordmark img { width: 33px; height: 33px; }
  .wordmark-en { display: none; }
  .direction { min-width: 32px; }
  .game-tools, .tool-group, .direction-pad { gap: 4px; }
  .restart-symbol { display: none; }
}
@media (max-height: 680px) and (min-width: 707px) {
  :root { --footer-h: 0px; --header-gap: 7px; --header-h: 51px; }
  .play-card { --panel-padding: 9px; --play-gap: 6px; }
  .site-footer { display: none; }
}
@media (max-height: 640px) and (max-width: 706px) and (orientation: portrait) {
  :root { --header-h: 43px; --footer-h: 0px; --header-gap: 5px; }
  .introduction h1 { font-size: clamp(1.6rem, 5.25dvh, 2.25rem); }
  .introduction p, .site-footer { display: none; }
  .play-card { --panel-padding: 8px; --play-gap: 5px; }
  .quiet-button { min-height: 32px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --header-h: 44px; --footer-h: 0px; --header-gap: 6px; --gutter: clamp(10px, 2.8vw, 32px); }
  .play { display: block; }
  .welcome, .site-footer { display: none; }
  .play-card {
    position: relative;
    margin-inline: auto;
    max-width: 670px;
    height: 100%;
    min-height: 0;


    align-items: stretch;
    align-content: center;
    column-gap: 10px;
    row-gap: 6px;
    --panel-padding: 8px;
    border-radius: 15px;
  }

  .mode-switch, .scorebar, .game-tools, .progress-card, .game-instructions { grid-column: 2; }
  .game-tools { flex-wrap: wrap; }
  .scorebar { grid-template-columns: 1fr 1fr; }
  .restart { grid-column: 1 / -1; }
  .game-instructions { font-size: .72rem; }
}
@media (max-height: 335px) {
  :root { --header-h: 36px; }
  .quiet-button { min-height: 30px; }
  .wordmark img { width: 31px; height: 31px; }
  .wordmark-en, .game-instructions { display: none; }
  .play-card { --panel-padding: 6px; --play-gap: 4px; }
  .mode { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* The available grid row caps the square board on short screens. */
.play { grid-template-rows: minmax(0, 1fr); align-content: stretch; align-items: center; }
.play-card {
  height: min(100%, 727px);
  align-content: stretch;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  --board-cap: 470px;
}
.board-wrap { display: grid; place-items: center; width: 100%; min-width: 0; min-height: 0; container-type: size; }
.board { width: min(100%, 100cqh, var(--board-cap)); }
.tile-image, .stamp img, .book-item img, .goal-picture img { mix-blend-mode: multiply; }
.discovery { color: #3c6d49; font-weight: 750; }
@media (max-width: 706px) and (orientation: portrait) {
  .play { grid-template-rows: auto minmax(0, 1fr); }
  .play-card { height: min(100%, calc(100vw + 205px), 685px); --board-cap: 430px; }
}
@media (min-height: 755px) and (max-width: 706px) and (orientation: portrait) {
  .introduction {
    min-height: clamp(72px, 12dvh, 115px);
    display: grid;
    align-content: center;
    border-radius: 14px;
    border: 1px solid #62857440;
    padding: 7px 10px;
    color: #fffbea;
    background: linear-gradient(95deg, #234d3bea, #245445ae), url("./valley-cover.jpg") center 53% / cover;
  }
  .introduction p { color: #f1f3df; }
  .introduction h1 { font-size: clamp(2rem, 4.6dvh, 2.8rem); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .play { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .play-card {
    height: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(186px, .87fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    align-items: center;
    --board-cap: 390px;
  }
  .board-wrap { grid-area: 1 / 1 / 6 / 2; align-self: stretch; }
  .board { grid-area: auto; }
  .mode-switch { align-self: end; }
  .scorebar { grid-template-columns: 1fr 1fr auto; }
  .restart { grid-column: auto; gap: 0; }
  .restart-symbol { display: none; }
  .progress-card { min-height: 39px; }
  .game-instructions { align-self: start; }
  .direction { min-width: 32px; }
}
@media (max-height: 345px) and (orientation: landscape) {
  .play-card { grid-template-rows: 1fr auto auto 1fr; row-gap: 5px; }
  .board-wrap { grid-row: 1 / 5; }
  .game-instructions { display: none; }
  .progress-card { align-self: start; }
  .tool-button, .direction { min-height: 31px; }
}
@media (max-height: 470px) and (orientation: portrait) {
  :root { --header-h: 37px; --footer-h: 0px; }
  .welcome, .site-footer { display: none; }
  .play { grid-template-rows: minmax(0, 1fr); }
}
@media (max-height: 320px) {
  .mode { height: 25px; }
  .score-tile { padding-block: 3px; }
  .score-tile output { font-size: 1.08rem; }
  .solid-button, .quiet-button, .direction, .tool-button { min-height: 29px; }
  .progress-card { min-height: 34px; }
  .goal-picture { width: 25px; height: 25px; }
}
