:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #20392f;
  background: #edf4ef;
  font-synthesis: none;
  --muted: #52685d;
  --border: #ceddd4;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: radial-gradient(ellipse at 50% 18%, #f7faf4, #e6efe8 95%);
}
.dashboard { width: min(100%, 44rem); }
.profile {
  display: flex;
  align-items: center;
  gap: clamp(.65rem, 2.8vw, 1.1rem);
  margin-bottom: clamp(.95rem, 3vw, 1.5rem);
}
.avatar {
  flex: 0 0 auto;
  display: block;
  width: clamp(2.8rem, 9.5vw, 4rem);
  aspect-ratio: 1;
  padding: .1875rem;
  border: 1px solid var(--border);
  background: #fff;
}
.avatar img { display: block; width: 100%; height: 100%; }
h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4.6vw, 2.65rem);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1.1;
}
.latin {
  margin-left: .22em;
  color: #4c6c60;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.045em;
}
.profile-link, button {
  display: inline-grid;
  place-items: center;
  min-height: 2.65rem;
  padding: .45rem .85rem;
  border: 1px solid #b4c8bb;
  border-radius: 0;
  background: #fcfdfb;
  color: #274b3d;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.profile-link { margin-left: auto; }
.profile-link:hover { background: #e6f1e8; }
:focus-visible { outline: 2px solid #397d69; outline-offset: 3px; }

.counter {
  border: 1px solid #b9ccc1;
  background: #fff;
  box-shadow: 0 1.25rem 2.8rem #2d573015;
}
.scene {
  position: relative;
  padding: clamp(1rem, 3.8vw, 1.6rem) clamp(.8rem, 4vw, 2rem) .7rem;
}
.fishing-art {
  display: block;
  width: min(53%, 17rem);
  height: auto;
  margin-left: 50%;
  transform: translateX(-7.1%);
}
.fishing-line {
  width: clamp(1px, .45vw, 2px);
  height: .78rem;
  margin-inline: auto;
  background: #424746;
}
.reading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(.5rem, 2vw, 1rem);
}
h2 {
  justify-self: end;
  margin: 0;
  color: #4c6057;
  font-size: clamp(.875rem, 2.5vw, 1.05rem);
  font-weight: 650;
  white-space: nowrap;
}
.count { min-width: 0; margin: 0; }
.digits {
  display: flex;
  justify-content: center;
  gap: clamp(.19rem, .85vw, .4rem);
  --tile-width: clamp(1.52rem, 7.6vw, 3.35rem);
  --tile-height: clamp(2.1rem, 10vw, 4.15rem);
  --glyph-size: clamp(1.52rem, 7vw, 3.1rem);
}
.digits[data-size="compact"] {
  gap: clamp(.11rem, .55vw, .27rem);
  --tile-width: clamp(.82rem, 4.5vw, 2.1rem);
  --tile-height: clamp(1.65rem, 7vw, 3.1rem);
  --glyph-size: clamp(.9rem, 4.5vw, 2.15rem);
}
.digit {
  display: grid;
  flex: 0 1 var(--tile-width);
  place-items: center;
  width: var(--tile-width);
  min-width: 0;
  height: var(--tile-height);
  border: 1px solid #d3dfd8;
  background: linear-gradient(#f1f7f3, #fff 67%, #f6faf7);
  box-shadow: inset 0 1px #fff, 0 2px 3px #1a4b3110;
  color: #19231e;
  font-family: "Times New Roman", Georgia, serif;
  font-size: var(--glyph-size);
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.digit-bounce { animation: digit-bounce 540ms ease-in-out; }
@keyframes digit-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  36% { transform: translateY(-.15em) scale(1.07); }
  69% { transform: translateY(.035em) scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  .digit-bounce { animation: none; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.milestone {
  min-height: 1.35em;
  margin: .65rem 0 0;
  color: #875416;
  font-size: clamp(.875rem, 3vw, 1rem);
  font-weight: 700;
  text-align: center;
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.confetti span {
  position: absolute;
  top: 74%;
  left: 50%;
  width: .42rem;
  height: .64rem;
}
.confetti span:nth-child(3n) { height: .42rem; }
.counter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .75rem clamp(.8rem, 4vw, 1.35rem);
  border-top: 1px solid #e1ebe4;
  background: #f8fbf8;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: var(--muted);
  font-size: .875rem;
}
.state::before {
  content: "";
  width: .43rem;
  height: .43rem;
  background: currentColor;
}
.state[data-state="live"] { color: #2e6d4d; }
.state[data-state="warn"] { color: #875416; }
button { background: #deece3; }
button:enabled:hover { background: #cedfd4; }
button:disabled { opacity: .62; cursor: wait; }
.no-script { margin: .45rem 0 0; text-align: center; }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .45rem 1rem;
  padding: .85rem .1rem 0;
  color: var(--muted);
  font-size: .875rem;
}
.uid { font-family: "Cascadia Mono", Consolas, monospace; }

@media (max-width: 35rem) {
  .reading { grid-template-columns: minmax(0, 1fr); row-gap: .45rem; }
  .count { grid-row: 1; }
  h2 { justify-self: center; }
}
@media (max-width: 26rem) {
  .profile-link, button { min-height: 2.4rem; padding-inline: .58rem; }
}
@media (max-width: 20rem) {
  .profile { flex-wrap: wrap; }
}
