:root {
  color-scheme: light;
  --page: #fff8eb;
  --stage: #2c1b47;
  --stage-muted: #dacbe9;
  --ink: #271c43;
  --muted: #655875;
  --violet: #5635ce;
  --hero-background: #ffcf59;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--stage);
  color: var(--ink);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }

.hunt-page {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right, 0px))
    env(safe-area-inset-bottom, 0px) max(20px, env(safe-area-inset-left, 0px));
  color: #fff;
}
.hunt-header, .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
}
.site-name, .corner-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 750;
}
.site-name { font-size: 15px; }
.brand-mark {
  width: 29px;
  height: 29px;
  flex: none;
}
.corner-control {
  padding-inline: 12px;
  border: 1px solid #ffffff38;
  border-radius: 13px;
  background: #ffffff12;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.hunt-page :focus-visible { outline-color: #8ee7f8; }
.hunt-main {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 14px 0 32px;
}
.scan-prompt { text-align: center; }
.scan-icon {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 0 auto 24px;
  border: 1px solid #ffffff31;
  border-radius: 50%;
  background: #ffffff0d;
}
.scan-prompt h1, .feedback h1 {
  margin: 0;
  font-size: clamp(23px, 6.5vw, 32px);
  font-weight: 850;
  line-height: 1.25;
}
.scan-prompt p, .feedback p {
  margin: 9px 0 0;
  color: var(--stage-muted);
  font-size: 14px;
  line-height: 1.55;
}
.activity-panel {
  width: min(100%, 468px);
  height: 100%;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right, 0px))
    env(safe-area-inset-bottom, 0px) max(20px, env(safe-area-inset-left, 0px));
  border: 0;
  background: var(--page);
  color: var(--ink);
  overscroll-behavior: contain;
}
.activity-panel::backdrop { background: #1a1226d9; }
.panel-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--page);
}
.panel-header h2 { margin: 0; font-size: 18px; }
.panel-close { border-color: #dfd0eb; background: #fffdf9; }
.preview-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.preview-label a { color: var(--violet); font-weight: 750; text-decoration: underline; }
.hero {
  overflow: hidden;
  padding: 20px 18px 0;
  border-radius: 26px;
  background: radial-gradient(ellipse at top, #ffffff64 4%, transparent 65%), var(--hero-background);
  text-align: center;
}
.hero-art {
  display: block;
  width: calc(100% + 36px);
  height: auto;
  margin: 10px -18px 0;
}
.hero-copy { padding-bottom: 10px; }
.hero-date {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 730;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.hero h3 {
  margin: 0;
  font-size: clamp(28px, 8.9vw, 39px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.055em;
}
#hero-description {
  margin: 8px 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}
.puzzle {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #eee1ce;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 5px 0 #f2e4cf;
}
.puzzle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.puzzle h3 { margin: 0; font-size: 22px; font-weight: 850; }
output {
  padding: 4px 10px;
  border-radius: 100px;
  background: #eee7ff;
  color: #4f30b8;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  margin: 13px 0 14px;
  border: 0;
  border-radius: 99px;
  background: #eee7ff;
  accent-color: var(--violet);
}
progress::-webkit-progress-bar { background: #eee7ff; }
progress::-webkit-progress-value { border-radius: 99px; background: var(--violet); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--violet); }
.board {
  width: min(100%, 336px);
  margin-inline: auto;
  padding: 6px;
  border-radius: 18px;
  background: #e7dbfa;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e6d6fa;
  border-radius: 12px;
  background: #f4eefe;
}
.slot::before {
  width: 28%;
  aspect-ratio: 1;
  background: url("../assets/duo.png") center / contain no-repeat;
  filter: saturate(0);
  opacity: 0.46;
  content: "";
}
.slot.unlocked {
  border: 0;
  background: #1a92d1;
}
.slot.unlocked::before { filter: none; opacity: 0.8; }
.slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.completed-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
}
.puzzle-message {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.reward {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--violet);
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}
.reward-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.notice {
  padding: 12px 14px;
  margin: 12px 0;
  border: 1px solid #edc57f;
  border-radius: 13px;
  background: #fff0c8;
  color: #59431e;
  font-size: 14px;
  line-height: 1.6;
}
.notice p { margin: 0; }
.notice-action {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #432695;
  cursor: pointer;
  font-weight: 750;
}
.rules {
  margin-top: 18px;
  padding: 0 14px;
  border: 1px solid #eadcc8;
  border-radius: 16px;
  background: #fffdf9;
}
.rules summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 800;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary span { font-size: 18px; }
.rules[open] summary span { transform: rotate(45deg); }
.rules ol, .rules p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.rules ol { padding-left: 24px; }
.rules li + li { margin-top: 5px; }
footer {
  padding: 17px 8px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.feedback {
  width: min(100%, 410px);
  text-align: center;
}
.feedback-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 54svh;
  aspect-ratio: 1;
  margin: 0 auto 16px;
}
.feedback-animation { position: absolute; inset: 0; width: 100%; height: 100%; }
.receipt-board {
  width: 78%;
  padding: 8px;
  background: #8ed3df;
  box-shadow: 0 9px 0 #467d91;
}
.receipt-board .slot { border: 1px solid #4d7d96; background: #214458; }
.receipt-board .slot.unlocked { border: 0; background: #1a92d1; }
.receipt-board .slot::before { filter: grayscale(1) brightness(1.8); opacity: 0.7; }
.receipt-actions {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 57px;
  margin: 11px auto 0;
}
.feedback[data-receipt="complete"] .receipt-actions { min-height: 98px; }
.receipt-reward {
  width: min(100%, 260px);
  margin: 0;
  background: #9be9f6;
  color: #213548;
}
.feedback-replay {
  min-height: 44px;
  padding-inline: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--stage-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.feedback:not([data-playback="settled"]) .feedback-replay { visibility: hidden; }

@media (min-width: 600px) {
  .activity-panel { height: calc(100% - 48px); border-radius: 24px; }
}
