:root {
  color-scheme: light;
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  --ink: #182820;
  --forest: #213a30;
  --paper: #f3eee4;
  --gold: #ecc47c;
  --line: #d8cec0;
  --muted: #514b40;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); min-height: 100vh; margin: 0; }
button, select, a { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #936127; outline-offset: 3px; }
[hidden] { display: none !important; }
.site-head {
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(20px, calc((100% - 1000px) / 2));
  background: var(--ink);
  color: #f9f3e7;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.brand small { display: block; color: var(--gold); font-size: 12px; font-weight: 500; }
.sample { color: var(--gold); font-size: 13px; border: 1px solid #746341; border-radius: 50px; padding: 5px 12px; }
main { max-width: 860px; margin: auto; padding: 32px 22px 26px; }
.intro { margin-block: 0 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 3.45rem); line-height: 1.15; }
.intro p { margin-top: 8px; font-size: 1.03rem; color: var(--muted); }
.layout { display: grid; grid-template-columns: 1.08fr 1fr; align-items: start; gap: 22px; }
.card {
  overflow: hidden;
  border: 1px solid #3a4e43;
  border-radius: 23px;
  background: var(--ink);
  color: #fff7e6;
  box-shadow: 0 16px 34px #32241926;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 19px;
  font-size: 14px;
  color: #f4e5c5;
}
.card-head span:last-child { color: var(--gold); }
.card-art { height: 100px; background: #41342a url("./lattice.png") center / cover; border-block: 1px solid #88633d; }
.card-body { padding: 14px 19px 16px; }
.balance { display: flex; justify-content: space-between; align-items: center; }
.balance h2 { font-size: 1.8rem; line-height: 1.2; }
.balance p, .qr-area p { color: #e4d8c5; font-size: .875rem; }
.balance p { margin-top: 3px; min-height: 1.3em; }
.seal { opacity: .82; }
.stamps { margin-top: 13px; display: grid; gap: 9px; grid-template-columns: repeat(5, 1fr); }
.stamps span { display: grid; place-items: center; height: 37px; border: 1px solid #826c4a; border-radius: 18px 18px 5px 5px; background: #23352c; }
.stamps span::before { content: "✧"; color: #bda97f; }
.stamps .earned { border-color: var(--gold); background: var(--gold); }
.stamps .earned::before { content: "✦"; color: #213329; }
.qr-area { margin-top: 15px; text-align: center; }
.qr-area img { display: block; margin: 0 auto 7px; background: white; border-radius: 10px; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fffaf0; }
label { display: block; font-size: .9rem; margin-bottom: 7px; font-weight: 700; }
select {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 7px 12px 7px 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fffdf8;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%);
  background-position: 14px 19px, 20px 19px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.modes { display: flex; margin: 15px 0 18px; padding: 4px; gap: 4px; border-radius: 11px; background: #eee7db; }
.modes button { flex: 1; min-height: 42px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; }
.modes button[aria-pressed="true"] { background: var(--forest); color: white; font-weight: 700; }
.panel h2 { font-size: 1.19rem; }
.panel p { color: var(--muted); margin-top: 7px; }
.action { width: 100%; min-height: 46px; display: grid; place-items: center; margin-top: 13px; border: 0; border-radius: 10px; color: #fff; background: var(--forest); text-decoration: none; font-weight: 700; cursor: pointer; }
#notice { font-size: .88rem; font-weight: 700; color: var(--forest); }
#notice:empty { display: none; }
.scope { margin-top: 12px; padding-inline: 4px; font-size: .9rem; color: var(--muted); }
footer { text-align: center; padding: 0 20px 20px; font-size: .78rem; font-weight: 700; letter-spacing: .19em; color: var(--muted); }
@media (max-width: 665px) {
  .site-head { padding-inline: 16px; }
  main { width: min(100%, 475px); padding: 23px 15px; }
  .intro { margin-bottom: 17px; }
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .card-art { height: 79px; }
}

.secondary { background: transparent; color: var(--forest); border: 1px solid var(--forest); }
#scanner-video { display: block; width: 100%; max-height: 250px; object-fit: cover; border-radius: 10px; margin-top: 10px; background: var(--ink); }
