:root {
  color-scheme: light;
  --page: #f5f8f7;
  --ink: #26332e;
  --green: #18886a;
  --deep: #116e54;
  --line: #dce6df;
  --gold: #c07709;
  font: 16px/1.55 "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--deep); outline-offset: 4px; }
.top { background: white; border-bottom: 1px solid var(--line); }
.top-inner, .hero-inner, .map { width: min(100% - 64px, 1360px); margin: auto; }
.top-inner { min-height: 70px; padding-block: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; gap: 14px; align-items: center; color: inherit; font-size: clamp(17px, 2.4vw, 24px); font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { margin: 4px; display: grid; grid-template-columns: repeat(2, 10px); gap: 4px; rotate: 45deg; }
.brand-mark i { width: 10px; height: 10px; border-radius: 1px; background: #17a27a; }
.brand-mark i:last-child { background: #65c9a7; }
.progress-controls { display: flex; justify-content: end; gap: 8px; flex-wrap: wrap; }
.control-divider { width: 1px; min-height: 28px; margin-inline: 3px; background: var(--line); }
.icon-control { gap: 6px; padding-inline: 11px; }
.icon-control > span:first-child { font-size: 21px; line-height: 1; font-weight: 500; }
.icon-control:disabled { opacity: .52; }
button, .continue, .card-link, .state-tag {
  min-height: 44px;
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button { background: white; color: var(--deep); border: 1px solid #a5c8b7; cursor: pointer; }
button:hover:not(:disabled) { background: #e8f6ee; }
button:disabled { color: #52665b; border-color: var(--line); background: #f8faf9; cursor: default; }
.hero { position: relative; overflow: hidden; background: #e8f5ef; border-bottom: 1px solid #d8ebe0; }
.hero-inner { position: relative; min-height: clamp(180px, 26vw, 350px); padding-block: 28px; display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 1; padding-block: 16px; }
h1, h2, h3, p { margin: 0; }
.hero-kicker { margin-bottom: 5px; color: var(--deep); font-size: clamp(17px, 2.3vw, 25px); font-weight: 800; letter-spacing: .08em; }
h1 { color: #183a32; font-size: clamp(32px, 5vw, 60px); line-height: 1.2; font-weight: 900; letter-spacing: .015em; }
.stars { display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px; margin: 15px 12px 0 0; border-radius: 999px; background: #fff4d7; color: #564013; font-size: 20px; font-variant-numeric: tabular-nums; }
.stars span:first-child { color: var(--gold); font-size: 24px; line-height: 1; }
.continue { background: var(--deep); color: white; }
.continue:hover, .current .card-link:hover { background: #0f5b44; }
.hero-art { position: absolute; inset: 0 calc(-1 * max(32px, (100vw - 1360px) / 2)) 0 35%; pointer-events: none; }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 55%; mask-image: linear-gradient(90deg, transparent, #000 34%); }
#local-game { position: fixed; inset: 0; z-index: 10; display: block; width: 100%; height: 100%; border: 0; background: var(--page); }
body.local-playing { overflow: hidden; }
.map { padding-block: 28px 52px; }
.map h2 { margin: 0 0 18px; border-inline-start: 7px solid var(--green); padding-inline-start: 12px; color: #193831; font-weight: 850; font-size: clamp(25px, 3.4vw, 35px); line-height: 1.2; }
.levels { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2.7vw, 36px); padding: 0; margin: 0; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: clamp(12px, 1.5vw, 20px); min-width: 0; background: white; border: 1px solid var(--line); border-radius: 17px; }
.card.current { border: 2px solid var(--green); box-shadow: 0 0 0 4px #dcefe6, 0 10px 24px #116e5416; }
.cover { aspect-ratio: 1; display: grid; background: #cbe8dc; border-radius: 10px; overflow: hidden; }
.cover img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.card:nth-child(4n+2) .cover { background: #fee2c1; }
.card:nth-child(4n+3) .cover { background: #d8e8d5; }
.card:nth-child(4n+4) .cover { background: #d7e8ef; }
.card.locked .cover img { filter: saturate(.55); opacity: .61; }
.card h3 { flex: 1; display: flex; align-items: start; gap: 10px; font-size: clamp(16px, 2vw, 24px); line-height: 1.3; overflow-wrap: anywhere; }
.card h3 span { font-variant-numeric: tabular-nums; border-inline-end: 1px solid var(--line); color: var(--deep); padding-inline-end: 10px; }
.card-actions { display: grid; justify-items: stretch; gap: 5px; }
.card-link, .state-tag { min-height: 41px; padding: 5px 8px; text-align: center; }
.current .card-link { background: var(--deep); color: white; }
.done .card-link { background: #fff3d8; color: #624509; }
.done .card-link:hover { background: #ffebbf; }
.review-link { padding: 5px; text-align: center; text-underline-offset: 2px; color: var(--deep); font-size: 14px; }
.state-tag { color: #465b51; background: #eef3f0; }
.notice { margin-bottom: 18px; padding: 12px 16px; border: 1px solid #b2d7c7; background: white; border-radius: 9px; }
.medal { display: flex; align-items: center; gap: 20px; padding: 18px; margin-bottom: 26px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.medal img { flex-shrink: 0; width: min(31vw, 140px); height: auto; border-radius: 9px; }
.medal h2 { border: 0; padding: 0; margin: 0 0 5px; }
#clear-dialog { width: min(490px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: var(--ink); }
#clear-dialog::backdrop { background: #172f25aa; }
#clear-dialog p { margin-block: 12px 22px; }
.confirm-actions { display: flex; justify-content: end; gap: 10px; }
button.danger { background: #9c3535; color: white; border-color: #9c3535; }
button.danger:hover:not(:disabled) { background: #7e2525; }
@media (min-width: 981px) {
  .card:not(:nth-child(4n)):not(:last-child)::after { content: "•••"; position: absolute; right: calc(-1 * clamp(12px, 2.7vw, 36px)); width: clamp(12px, 2.7vw, 36px); top: 35%; text-align: center; color: #85bdab; font-size: clamp(8px, 1.15vw, 15px); pointer-events: none; }
}
@media (max-width: 980px) {
  .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .top-inner, .hero-inner, .map { width: calc(100% - 30px); }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-inner { align-items: start; }
  .brand { align-self: center; }
  .progress-controls { gap: 5px; }
  .progress-controls button { padding-inline: 8px; min-height: 38px; font-size: 13px; }
  .control-divider { display: none; }
  .icon-control > span:first-child { font-size: 18px; }
  .hero-inner { gap: 8px; }
  .hero-art { left: 30%; right: -15px; opacity: .7; }
}
@media (max-width: 360px) {
  .top-inner { flex-wrap: wrap; }
  .hero-art { display: none; }
  .card { padding: 8px; }
}

