:root {
  --primary: #1F7A4D;
  --primary-2: #3F92B8;
  --primary-soft: #DCECDD;
  --green: #2F8B57;
  --green-2: #145A3A;
  --green-soft: #C6DFCC;
  --yellow: #FFD86A;
  --yellow-soft: #FFF1BE;
  --yellow-dark: #E59A33;
  --surface: #FFF9EC;
  --surface-low: #EDF8D3;
  --surface-mid: #B6D9C0;
  --cream: #FFF3D2;
  --text: #283239;
  --muted: #66746D;
  --line: rgba(20, 90, 58, .18);
  --danger: #EC7568;
  --basalt: #2E383D;
  --shadow: 0 18px 36px rgba(26, 88, 61, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 4%, rgba(255, 216, 106, .34), transparent 18rem),
    radial-gradient(circle at 90% 96%, rgba(31, 122, 77, .22), transparent 24rem),
    #222323;
}

button, a { font: inherit; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 550, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.app-shell {
  width: min(100vw, 430px);
  height: 100dvh;
  min-height: 720px;
  margin: 0 auto;
  background:
    radial-gradient(circle at 15% 6%, rgba(255, 216, 106, .42), transparent 9rem),
    radial-gradient(circle at 88% 12%, rgba(105, 205, 216, .26), transparent 12rem),
    linear-gradient(180deg, #FFE7B2 0%, #BFE2D2 42%, #DCECD3 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 24px 80px rgba(31,51,43,.32);
}

.topbar {
  height: 66px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 249, 236, .78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(73, 129, 99, .14);
  position: relative;
  z-index: 4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #145A3A, #2F8B57);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(20, 90, 58, .24);
}

.brand strong {
  display: block;
  color: var(--green-2);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--green-2);
  background: rgba(255,255,255,.72);
  display: grid;
  place-items: center;
}

main {
  height: calc(100% - 66px);
  overflow-y: auto;
  padding: 18px 18px 108px;
  scrollbar-width: none;
}

main::-webkit-scrollbar { display: none; }

.screen { display: none; animation: appear .24s ease both; }
.screen.active { display: block; }

@keyframes appear {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, h2, h3, p { margin: 0; letter-spacing: 0; }

.hero-card, .selected-tour {
  min-height: 226px;
  border-radius: 28px;
  padding: 18px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 86% 16%, #FFD86A 0 9%, transparent 10%),
    radial-gradient(circle at 14% 74%, rgba(255, 139, 94, .32) 0 11%, transparent 12%),
    linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.03)),
    linear-gradient(135deg, #7BCDBE 0%, #C9E7DB 44%, #F3B66C 100%);
  box-shadow: var(--shadow);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .9;
  background:
    radial-gradient(ellipse at 24% 24%, rgba(255,255,255,.45) 0 16%, transparent 17%),
    repeating-radial-gradient(ellipse at 20% 4%, transparent 0 30px, rgba(255,255,255,.38) 31px 33px, transparent 34px 62px),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.24));
  background-size: auto, 150% 88px, auto;
}

.selected-tour::after {
  display: none;
}

.selected-tour {
  padding: 0;
  background-color: var(--surface-mid);
}

.hero-card > *, .selected-tour > * {
  position: relative;
  z-index: 1;
}

.hero-copy h1, .selected-tour h1 {
  margin-top: 42px;
  font-size: 30px;
  line-height: 1.12;
  max-width: 330px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy p, .selected-tour p {
  margin-top: 12px;
  color: rgba(40,50,57,.78);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}

.pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green-2);
  background: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.light {
  color: var(--green-2);
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(12px);
}

.pill .material-symbols-outlined { font-size: 15px; }

.today-ring {
  display: grid;
  place-items: center;
  margin: 18px 0 14px;
}

.ring {
  width: 198px;
  height: 198px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--primary) var(--progress, 0deg), rgba(255,255,255,.74) 0deg);
  box-shadow: var(--shadow);
  position: relative;
}

.ring::after {
  content: "";
  width: 158px;
  height: 158px;
  border-radius: 50%;
  background: rgba(255,249,236,.94);
  position: absolute;
  box-shadow: inset 0 0 0 1px rgba(73,129,99,.12);
}

.ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ring span {
  color: var(--primary);
  font-size: 35px;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  50% { transform: translateY(-5px); }
}

.ring strong {
  display: block;
  font-size: 34px;
  line-height: 1.04;
}

.ring small, .metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card, .control-card, .anti-cheat-card, .convert-card, .report-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 236, .82);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 118px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card .material-symbols-outlined {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.blue { color: #338FB7; background: #D4EEF5; }
.green { color: var(--green-2); background: var(--green-soft); }
.yellow { color: var(--yellow-dark); background: var(--yellow-soft); }
.basalt { color: #ffffff; background: var(--basalt); }

.metric-card strong {
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
}

.section-head {
  margin: 24px 0 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-head.top { margin-top: 0; }
.section-head.compact { margin: 0 0 12px; }

.section-head h2 {
  font-size: 21px;
  line-height: 1.2;
  color: var(--text);
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 900;
}

.tour-stack, .nft-stack {
  display: grid;
  gap: 12px;
}

.guide-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.guide-card {
  min-height: 214px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 249, 236, .86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guide-illustration {
  height: 96px;
  border-radius: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,216,106,.9) 0 12%, transparent 13%),
    linear-gradient(180deg, #9FD8CF 0 48%, #F1C07B 49% 100%);
}

.guide-illustration::after {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: 25px;
  height: 24px;
  border-radius: 50%;
  border-top: 4px solid rgba(255,255,255,.55);
}

.guide-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
}

.guide-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
  font-weight: 700;
}

.guide-sun {
  position: absolute;
  width: 22px;
  height: 22px;
  right: 16px;
  top: 13px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 8px rgba(255,216,106,.22);
}

.guide-pin {
  position: absolute;
  left: 17px;
  top: 31px;
  color: var(--danger);
  font-size: 34px;
  z-index: 2;
}

.guide-path {
  position: absolute;
  left: 30px;
  right: 19px;
  bottom: 22px;
  height: 28px;
  border-bottom: 5px dotted rgba(20,90,58,.58);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.guide-person {
  position: absolute;
  left: 46px;
  top: 23px;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #ffffff;
  background: var(--green-2);
  display: grid;
  place-items: center;
  font-size: 34px;
  z-index: 2;
}

.guide-step {
  position: absolute;
  width: 10px;
  height: 18px;
  border-radius: 999px;
  background: rgba(20,90,58,.48);
  bottom: 13px;
}

.guide-step.one { left: 24px; transform: rotate(18deg); }
.guide-step.two { left: 52px; transform: rotate(-16deg); }
.guide-step.three { left: 82px; transform: rotate(18deg); }

.guide-car {
  position: absolute;
  left: 14px;
  bottom: 17px;
  color: var(--basalt);
  font-size: 38px;
  z-index: 2;
}

.guide-leaf {
  position: absolute;
  right: 16px;
  top: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green-2);
  display: grid;
  place-items: center;
  font-size: 30px;
  z-index: 2;
}

.guide-arrow {
  position: absolute;
  left: 55px;
  top: 35px;
  color: var(--green-2);
  font-size: 32px;
  z-index: 2;
}

.guide-medal {
  position: absolute;
  left: 18px;
  top: 21px;
  width: 50px;
  height: 50px;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-2), #65BBD8);
  display: grid;
  place-items: center;
  font-size: 32px;
  z-index: 2;
}

.guide-coin {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #3E3B21;
  background: var(--yellow);
  border: 4px solid rgba(255,255,255,.72);
  font-weight: 900;
  font-size: 21px;
  z-index: 2;
}

.guide-spark {
  position: absolute;
  right: 58px;
  top: 18px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #FF8B6B;
  transform: rotate(45deg);
  box-shadow: 0 25px 0 rgba(255,216,106,.88);
}

.tour-card {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 249, 236, .9);
  text-align: left;
  box-shadow: var(--shadow);
}

.tour-image {
  height: 92px;
  background-color: var(--primary-soft);
  background-image: linear-gradient(180deg, rgba(255,255,255,.04), rgba(45,73,61,.16)), var(--photo);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.tour-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.02));
}

.tour-info {
  padding: 13px 14px 14px;
}

.tour-info h3 {
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 900;
}

.tour-desc {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.tour-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.control-card, .anti-cheat-card, .convert-card {
  padding: 14px;
  margin-top: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.status-row strong {
  font-size: 18px;
  color: var(--text);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.status-dot.live, .status-dot.ok { background: var(--green); box-shadow: 0 0 0 7px rgba(21,104,32,.13); }
.status-dot.warn { background: var(--yellow); box-shadow: 0 0 0 7px rgba(255,216,106,.28); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 7px rgba(186,26,26,.12); }

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button, .secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-2), #65BBD8);
  box-shadow: 0 10px 24px rgba(62, 151, 194, .22);
}

.secondary-button {
  color: var(--green-2);
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
}

.map-card {
  height: 246px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
  background: #CDEBD3;
  box-shadow: var(--shadow);
}

.map-toolbar {
  position: absolute;
  inset: 12px 12px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.map-toolbar a {
  color: var(--green-2);
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 7px 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

#routeMap {
  width: 100%;
  height: 100%;
  display: block;
}

.check-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-list div {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  padding: 12px;
}

.check-list div.pass {
  background: var(--green-soft);
  border-color: rgba(31,122,77,.36);
}

.check-list div.fail {
  background: rgba(255,91,91,.16);
  border-color: rgba(186,26,26,.22);
}

.check-list span {
  color: var(--primary);
  margin-bottom: 8px;
}

.check-list b {
  display: block;
  font-size: 12px;
  color: var(--text);
}

.check-list small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  margin-top: 3px;
}

.wallet-hero, .report-card {
  color: var(--text);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255,216,106,.48), transparent 7rem),
    linear-gradient(135deg, #E8F1D6, #BFDCCB 58%, #FFF3D2);
  box-shadow: var(--shadow);
}

.wallet-hero strong, .report-card strong {
  display: block;
  font-size: 40px;
  line-height: 1;
  margin: 18px 0 8px;
}

.wallet-hero p, .report-card p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.convert-card {
  display: grid;
  gap: 12px;
}

.certificate-entry {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 236, .9);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.certificate-entry label {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.certificate-entry input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255,255,255,.78);
  outline: none;
}

.certificate-entry input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98,190,120,.16);
}

.certificate-entry small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
}

.certificate-entry b {
  color: var(--primary);
}

.convert-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.convert-row > div {
  border-radius: 14px;
  background: rgba(255,255,255,.68);
  padding: 13px 8px;
  text-align: center;
}

.convert-row small {
  color: var(--muted);
  font-weight: 800;
}

.convert-row strong {
  display: block;
  font-size: 19px;
  margin-top: 4px;
  color: var(--text);
}

.nft-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 236, .9);
  padding: 12px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
}

.shop-list, .voucher-list {
  display: grid;
  gap: 12px;
}

.shop-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 249, 236, .92);
  padding: 12px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  box-shadow: var(--shadow);
}

.shop-card .primary-button, .shop-card .secondary-button {
  grid-column: 1 / -1;
}

.shop-card button:disabled {
  opacity: .58;
}

.shop-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  display: grid;
  place-items: center;
}

.shop-icon span {
  font-size: 29px;
}

.shop-card h3 {
  color: var(--text);
  font-size: 15px;
  line-height: 1.28;
  font-weight: 900;
  margin-bottom: 6px;
}

.shop-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
  font-weight: 700;
  margin-bottom: 10px;
}

.voucher-card, .empty-card, .verify-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 236, .9);
  padding: 14px;
  box-shadow: var(--shadow);
}

.voucher-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.voucher-card strong, .verify-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 900;
}

.voucher-card small, .verify-card p, .empty-card {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 750;
}

.verify-card {
  margin-top: 14px;
}

.verify-card p {
  margin-top: 8px;
  word-break: break-all;
}

#voucherCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #F5F7FA;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.nft-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background-color: var(--primary-soft);
  background-image: var(--photo);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.nft-card.locked .nft-thumb, .nft-card.locked .nft-art {
  filter: grayscale(1);
  opacity: .62;
}

.nft-card h3 {
  font-size: 13px;
  line-height: 1.25;
  color: var(--text);
  font-weight: 900;
}

.nft-card small {
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
}

.nft-card button {
  border: 0;
  border-radius: 12px;
  background: var(--yellow);
  color: #3E3B21;
  padding: 10px 11px;
  font-size: 12px;
  font-weight: 900;
}

.collection-preview {
  width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

#certificateCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #F5F7FA;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.certificate-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.nft-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nft-tile {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 236, .9);
  padding: 10px;
  text-align: center;
}

.nft-tile.nft-card {
  display: block;
  grid-template-columns: none;
}

.nft-art {
  aspect-ratio: 1;
  border-radius: 14px;
  background-color: var(--primary-soft);
  background-image: var(--photo);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 9px;
}

.nft-tile h3 {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
  font-weight: 900;
}

.nft-tile small {
  color: var(--muted);
  font-weight: 800;
  font-size: 10px;
}

.bottom-nav {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  height: 76px;
  border-radius: 26px;
  background: rgba(207, 225, 203, .96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.52);
  box-shadow: 0 -8px 30px rgba(62,106,82,.22);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  z-index: 5;
}

.bottom-nav button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #4F655A;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 900;
}

.bottom-nav button span {
  width: 34px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 21px;
}

.bottom-nav button.active { color: var(--green-2); }

.bottom-nav button.active span {
  color: #ffffff;
  background: var(--green-2);
  font-variation-settings: "FILL" 1, "wght" 650, "GRAD" 0, "opsz" 24;
}

@media (min-width: 680px) {
  body { padding: 22px 0; }

  .app-shell {
    border: 10px solid #202322;
    border-radius: 42px;
  }
}
