/* Lucky Cookie static demo. Design width 750, 1rem = 100px on a 750px viewport. */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #fefdfb;
  color: #6b2d17;
}

button, input { font-family: inherit; }

a { color: inherit; }

img { max-width: 100%; }

[hidden] { display: none !important; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #6b2d17;
  background:
    radial-gradient(120% 42% at 50% -8%, rgba(255, 196, 22, 0.1), transparent 60%),
    #fefdfb;
}

.wrap {
  width: 7.5rem;
  max-width: 100%;
  margin: 0 auto;
  flex: 1;
}

.pad { padding: 0 0.36rem 0.68rem; }

.head { display: block; width: 100%; }

.cookie-mini {
  display: block;
  width: 3.2rem;
  height: 2.2rem;
  margin: 0.16rem auto 0;
  object-fit: contain;
  user-select: none;
}

h1.display {
  margin: 0.08rem 0 0.12rem;
  text-align: center;
  font-size: 0.42rem;
  font-weight: 400;
  font-family: Georgia, "Times New Roman", serif;
}

.lede {
  margin: 0;
  text-align: center;
  font-size: 0.25rem;
  line-height: 1.5;
  color: #a06a44;
}

.serif { font-family: Georgia, "Times New Roman", serif; }

.muted { color: #a06a44; }
.brown { color: #7a4326; }
.red { color: #8c1d18; }

.row {
  display: flex;
  align-items: center;
  gap: 0.16rem;
}

.center-row { justify-content: center; }

.spin {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  border: 0.05rem solid rgba(160, 106, 68, 0.35);
  border-top-color: #a06a44;
  animation: lc-spin 0.7s linear infinite;
  flex: none;
}

.spin.sm { width: 0.36rem; height: 0.36rem; }

@keyframes lc-spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 0.84rem;
  padding: 0 0.48rem;
  border: 0;
  border-radius: 999px;
  background: #6b2d17;
  color: #fff;
  font-size: 0.28rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn.block { display: flex; width: 100%; margin-top: 0.28rem; }
.btn.center { display: flex; margin: 0.4rem auto 0; }
.btn.ghost {
  background: #fff;
  color: #6b2d17;
  border: 1px solid #6b2d17;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.linkish {
  display: inline;
  margin-top: 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a06a44;
  font-size: 0.24rem;
  text-decoration: underline;
  cursor: pointer;
}

.field { margin-top: 0.4rem; text-align: left; }

.field label {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.26rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 0.88rem;
  padding: 0 0.32rem;
  border: 1px solid #e7c79b;
  border-radius: 999px;
  background: #fff;
  color: #6b2d17;
  font-size: 0.3rem;
  outline: none;
}

.field input:focus { border-color: #6b2d17; }
.field input::placeholder { color: #c4a07a; }

.hint {
  margin: 0.16rem 0 0;
  font-size: 0.22rem;
  line-height: 1.45;
  color: #a06a44;
}

.section-title {
  margin: 0.48rem 0 0.2rem;
  text-align: left;
  font-size: 0.36rem;
  font-weight: 400;
  font-family: Georgia, "Times New Roman", serif;
}

.card {
  margin-bottom: 0.24rem;
  padding: 0.28rem 0.32rem;
  border: 1px solid #f3ddc0;
  border-radius: 0.24rem;
  background: #fff;
  text-align: left;
}

.card p { margin: 0; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.16rem;
}

.badge {
  flex: none;
  padding: 0.04rem 0.18rem;
  border-radius: 999px;
  font-size: 0.22rem;
  font-weight: 600;
}

.badge.gold { background: #fdbf12; color: #6b2d17; }
.badge.red { background: #f8e4e2; color: #8c1d18; }
.badge.soft { background: #f6efe6; color: #7a4326; }
.badge.paper { background: #fff7ea; color: #6b2d17; font-size: 0.2rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.16rem; margin-top: 0.2rem; }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 0.72rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-size: 0.24rem;
  font-weight: 600;
  text-decoration: none;
}

.chip.primary { background: #6b2d17; color: #fff; }
.chip.secondary { background: #fff; color: #6b2d17; border: 1px solid #e7c79b; }

.note {
  margin-bottom: 0.24rem;
  padding: 0.2rem 0.28rem;
  border-radius: 0.24rem;
  background: #fff7ea;
  text-align: left;
  font-size: 0.24rem;
  line-height: 1.45;
  color: #7a4326;
}

.footer {
  margin-top: auto;
  padding: 0.32rem 0.6rem calc(0.4rem + env(safe-area-inset-bottom));
  background: #fdbf12;
  color: #6b2d17;
  text-align: center;
}

.footer strong { font-size: 0.3rem; }

.footer p {
  max-width: 9.2rem;
  margin: 0.16rem auto 0;
  font-size: 0.25rem;
  line-height: 1.6;
}

.footer nav, .links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.12rem 0.36rem;
  margin-top: 0.24rem;
  font-size: 0.25rem;
}

.footer a, .links a { text-underline-offset: 0.04rem; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.28rem;
  padding: 0.06rem;
  border-radius: 999px;
  background: #f6e6d2;
}

.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0.76rem;
  border-radius: 999px;
  color: #6b2d17;
  font-size: 0.26rem;
  font-weight: 600;
  text-decoration: none;
}

.tabs a[aria-current="page"] { background: #6b2d17; color: #fff; }

.ranges {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.08rem;
  margin-top: 0.28rem;
}

.ranges button {
  height: 0.72rem;
  border: 1px solid #e7c79b;
  border-radius: 999px;
  background: #fff;
  color: #6b2d17;
  font-size: 0.24rem;
  font-weight: 600;
  cursor: pointer;
}

.ranges button[aria-pressed="true"] {
  border-color: #6b2d17;
  background: #6b2d17;
  color: #fff;
}

.panel {
  margin-top: 0.28rem;
  padding: 0.24rem 0.28rem;
  border: 1px solid #f3ddc0;
  border-radius: 0.24rem;
  background: #fff;
  text-align: left;
}

.panel h2 { margin: 0; font-size: 0.28rem; }

.panel .note-line {
  margin: 0.06rem 0 0;
  font-size: 0.22rem;
  line-height: 1.45;
  color: #a06a44;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.12rem;
  margin-top: 0.16rem;
}

.metric {
  padding: 0.16rem 0.2rem;
  border-radius: 0.2rem;
  background: #fff7ea;
}

.metric span { display: block; font-size: 0.22rem; color: #a06a44; }

.metric strong {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.4rem;
  font-weight: 400;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.bar, .mix {
  height: 0.16rem;
  margin-top: 0.16rem;
  overflow: hidden;
  border-radius: 999px;
  background: #f6e6d2;
}

.bar > i, .mix > i { display: block; height: 100%; background: #6b2d17; }
.mix { display: flex; height: 0.24rem; }
.mix > i.pending { background: #e7a04a; }
.mix > i.expired { background: #c4a07a; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.08rem 0.2rem;
  margin: 0.12rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.2rem;
  color: #a06a44;
}

.legend i {
  display: inline-block;
  width: 0.16rem;
  height: 0.16rem;
  margin-right: 0.08rem;
  border-radius: 999px;
  vertical-align: -0.02rem;
}

.batch-list, .day-list, .history-list {
  margin: 0.16rem 0 0;
  padding: 0;
  list-style: none;
}

.batch-list li, .day-list li, .history-list li {
  padding: 0.12rem 0;
  border-top: 1px solid #f3ddc0;
  font-size: 0.22rem;
  line-height: 1.45;
  color: #7a4326;
}

.mini-bar {
  height: 0.1rem;
  margin-top: 0.08rem;
  overflow: hidden;
  border-radius: 999px;
  background: #f6e6d2;
}

.mini-bar > i { display: block; height: 100%; background: #6b2d17; }

.chart-scroll { margin-top: 0.16rem; overflow-x: auto; }
.chart-scroll svg { display: block; width: 100%; height: auto; }
.chart-scroll svg.wide { width: auto; max-width: none; }

/* Lottery */

.stage {
  position: relative;
  width: 6.4rem;
  max-width: 84%;
  height: 4.4rem;
  margin: 0 auto;
}

.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.copy {
  min-height: 3.36rem;
  padding: 0 0.44rem;
  text-align: center;
}

.copy .status { padding-top: 0.68rem; color: #a06a44; font-size: 0.28rem; }
.copy .locked { padding-top: 1.2rem; color: #a06a44; font-size: 0.3rem; }
.copy .message { margin: 0; font-size: 0.3rem; line-height: 1.6; color: #8c1d18; }

.agree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
  max-width: 9.2rem;
  margin: 0.36rem auto 0;
  text-align: left;
  font-size: 0.25rem;
}

.agree input { width: 0.32rem; height: 0.32rem; accent-color: #6b2d17; }

.agree-hint {
  max-width: 9.2rem;
  margin: 0.2rem auto 0;
  font-size: 0.25rem;
  font-weight: 500;
  color: #8c1d18;
}

.img-btn {
  display: block;
  width: min(6rem, 84%);
  margin: 0.48rem auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.img-btn img { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }
.img-btn.dim { cursor: not-allowed; opacity: 0.4; }
.img-btn:active { transform: translateY(0.06rem); }

.prize {
  margin: 0.12rem 0 0.28rem;
  font-size: 0.42rem;
  line-height: 1.5;
  font-family: Georgia, "Times New Roman", serif;
}

.slip, .aside {
  margin: 0;
  font-size: 0.32rem;
  line-height: 1.65;
  color: #7a4326;
  font-family: Georgia, "Times New Roman", serif;
}

.slip { font-style: italic; }
.aside { margin-top: 0.2rem; }
.aside strong { color: #6b2d17; }

.jitter { animation: lcs-cookie-jitter 0.18s linear infinite; }
.pop { animation: lcs-cookie-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.fade-up { animation: lcs-fade-up 0.5s ease both; }

@keyframes lcs-cookie-jitter {
  0%, 100% { transform: translate(-0.1rem, 0) rotate(-3deg); }
  25% { transform: translate(0.12rem, -0.06rem) rotate(3deg); }
  50% { transform: translate(-0.1rem, 0.06rem) rotate(-3deg); }
  75% { transform: translate(0.1rem, -0.02rem) rotate(3deg); }
}

@keyframes lcs-cookie-pop {
  0% { opacity: 0; transform: scale(0.8); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes lcs-fade-up {
  from { opacity: 0; transform: translateY(0.32rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Coupon */

body.sheet { background: #fff; color: #712700; }
body.sheet .page { background: #fff; color: #712700; }

.coupon { position: relative; }

.coupon > img.art { display: block; width: 100%; height: auto; }

.qr-box {
  position: absolute;
  left: 29.07%;
  top: 40.31%;
  width: 41.78%;
  height: 19.29%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.qr-box svg { width: 100%; height: 100%; display: block; }

.coupon-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  font-size: 0.26rem;
  line-height: 0.38rem;
  font-weight: 500;
}

.detail-line {
  position: absolute;
  left: 50%;
  max-width: 92%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  font-size: 0.24rem;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}

.coupon-actions {
  position: absolute;
  top: 93.4%;
  left: 6%;
  width: 88%;
  height: 4.2%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
}

.coupon-actions button,
.coupon-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.08rem;
  color: #692705;
  font: inherit;
  font-size: 0.2rem;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0.06rem 0.14rem rgba(120, 72, 0, 0.18);
  -webkit-tap-highlight-color: transparent;
}

.coupon-extra, .coupon-nav {
  padding: 0.24rem 0.36rem 0;
  text-align: center;
  font-size: 0.26rem;
  line-height: 1.5;
}

.coupon-extra p { margin: 0; }
.coupon-nav { display: flex; justify-content: center; gap: 0.36rem; padding-bottom: 0.28rem; font-size: 0.24rem; }

/* Poster */

.poster-page { background: #fff; color: #1a1a1a; }
.poster-page .page { background: #fff; }

.poster {
  position: relative;
  width: 7.5rem;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 731 / 1583;
}

.poster .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.poster-back {
  position: absolute;
  z-index: 2;
  left: 3%;
  top: 1.5%;
  width: 0.52rem;
  height: 0.52rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #6b2d17;
  font-size: 0.32rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0.02rem 0.06rem rgba(0, 0, 0, 0.12);
}

.poster-fortune, .poster-blessing {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.poster-fortune { top: 11%; width: 80%; line-height: 1.45; }
.poster-blessing { top: 63%; width: 56%; font-size: 0.3rem; line-height: 0.44rem; }

.poster-qr {
  position: absolute;
  left: 50%;
  top: 70.7%;
  width: 22.1%;
  height: 11%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.poster-qr svg { width: 1.4rem; height: 1.4rem; }

.poster-foot {
  position: absolute;
  left: 0;
  right: 0;
  top: 84.2%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.36rem 0.36rem 0.32rem;
  color: #1a1a1a;
}

.poster-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
  width: 100%;
}

.poster-name, .poster-address {
  width: 100%;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.poster-name {
  font-size: 0.34rem;
  font-weight: 800;
  line-height: 0.44rem;
  text-transform: uppercase;
}

.poster-address { font-size: 0.22rem; line-height: 0.32rem; }

.pin { display: block; width: 0.24rem; height: 0.24rem; }

.poster-actions {
  display: flex;
  gap: 0.2rem;
  width: 100%;
  margin-top: auto;
}

.poster-actions button {
  flex: 1;
  height: 0.72rem;
  border: 0;
  border-radius: 999px;
  background: #f3f3f3;
  color: #1a1a1a;
  font-size: 0.26rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0.04rem 0.12rem rgba(0, 0, 0, 0.08);
}

.poster-actions button:disabled { opacity: 0.6; cursor: not-allowed; }

.mask, .share-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.mask {
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
}

.mask .close-preview {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 0.8rem;
  cursor: pointer;
}

.mask .preview-img { width: 50%; margin: 3rem auto 0; }

.mask p {
  margin: 0.4rem 0 0;
  padding: 0 0.4rem;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 500;
}

.share-mask {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.share-card {
  position: relative;
  width: 80%;
  max-width: 6rem;
  padding: 0.24rem;
  border-radius: 0.24rem;
  background: #e4f5ef;
  text-align: center;
  box-shadow: 0 0.2rem 0.7rem rgba(70, 31, 32, 0.28);
}

.share-card h2 {
  margin: 0.5rem 0;
  color: #7f3b3d;
  font-size: 0.32rem;
}

.share-card .x {
  position: absolute;
  top: 0.12rem;
  right: 0.16rem;
  width: 0.44rem;
  height: 0.44rem;
  border: 0;
  border-radius: 999px;
  background: #e4f5ef;
  cursor: pointer;
}

.share-card .x img { width: 100%; filter: brightness(0); opacity: 0.55; }

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  height: 0.65rem;
  margin: 0 auto;
  border: 0;
  border-radius: 0.14rem;
  color: #fff;
  font-size: 0.22rem;
  font-weight: 600;
  cursor: pointer;
}

.share-btn img { width: 0.3rem; margin-right: 0.15rem; }
.share-btn.email { background: #8c3f40; }
.share-btn.facebook { margin-top: 0.25rem; background: #1877f3; }
.share-card .pad-bottom { padding-bottom: 0.5rem; }

/* Scanner */

.scanner {
  min-height: 4.8rem;
  margin-top: 0.28rem;
  overflow: hidden;
  border-radius: 0.24rem;
  background: #000;
}

.scanner video { display: block; width: 100%; min-height: 4.8rem; object-fit: cover; }

.code-input { letter-spacing: 0.04em; text-transform: uppercase; }

/* Legal */

.legal-back {
  padding: 0.4rem 0.24rem 0.24rem;
}

.legal-back button {
  border: 0;
  background: transparent;
  color: #a06a44;
  font-size: 0.28rem;
  text-decoration: underline;
  cursor: pointer;
}

.legal {
  width: 7.5rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0.24rem 0.96rem;
}

.legal > h1 {
  margin: 0 0 0.32rem;
  font-size: 0.48rem;
  font-family: Georgia, "Times New Roman", serif;
}

.legal-h1 {
  margin: 0.48rem 0 0.24rem;
  font-size: 0.44rem;
  font-family: Georgia, "Times New Roman", serif;
}

.legal-h2 { margin: 0.4rem 0 0.16rem; font-size: 0.36rem; }
.legal-h3, .legal-num { margin: 0.4rem 0 0.08rem; font-size: 0.3rem; }
.legal-p { margin: 0 0 0.24rem; font-size: 0.27rem; line-height: 1.75; color: #7a4326; }
.legal-gap { height: 0.24rem; }

.legal-list {
  margin: 0.16rem 0;
  padding-left: 0.48rem;
  color: #7a4326;
  font-size: 0.27rem;
  line-height: 1.7;
}

.legal-table-wrap { margin: 0.32rem 0; overflow-x: auto; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.27rem;
}

.legal-table td {
  padding: 0.16rem 0.24rem;
  border: 1px solid #e7c79b;
  vertical-align: top;
}

.legal-table tr.head { background: #fdf0d8; }

/* Index */

.scenarios { margin-top: 0.28rem; text-align: left; }

.scenarios h2 {
  margin: 0.36rem 0 0.16rem;
  font-size: 0.3rem;
  font-family: Georgia, "Times New Roman", serif;
}

.scenario {
  display: block;
  width: 100%;
  margin: 0 0 0.16rem;
  padding: 0.22rem 0.28rem;
  border: 1px solid #f3ddc0;
  border-radius: 0.24rem;
  background: #fff;
  color: #6b2d17;
  font-size: 0.28rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.scenario small {
  display: block;
  margin-top: 0.06rem;
  color: #a06a44;
  font-size: 0.22rem;
  font-weight: 400;
  line-height: 1.45;
}

.status-box {
  margin-top: 0.28rem;
  padding: 0.24rem 0.28rem;
  border-radius: 0.24rem;
  background: #fff7ea;
  text-align: left;
  font-size: 0.24rem;
  line-height: 1.55;
  color: #7a4326;
}

.status-box p { margin: 0.08rem 0 0; }
.status-box p:first-child { margin-top: 0; }
