:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --text: #202124;
  --muted: #747474;
  --line: #ece7df;
  --card: #ffffff;
  --primary: #ffd33d;
  --primary-deep: #f5b700;
  --accent: #ff6b35;
  --green: #1c9b6b;
  --shadow: 0 10px 28px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding-bottom: 82px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: rgba(247, 247, 245, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(236, 231, 223, 0.72);
}

.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.city {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.language-select {
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 7px 10px;
  color: var(--text);
}

main {
  padding: 0 14px;
  max-width: 760px;
  margin: 0 auto;
}

.hero {
  margin: 12px 0 12px;
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, #ffe066 0%, #ffbd4a 52%, #ff774a 100%);
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.14;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
}

.points-chip {
  flex: 0 0 auto;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 88px;
  text-align: left;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.points-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.points-chip strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.search-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(32, 33, 36, 0.04);
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-panel input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #f2f2ef;
  padding: 12px 12px;
  outline: none;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.home-only[hidden] {
  display: none !important;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 9px 13px;
  white-space: nowrap;
  color: var(--text);
}

.tab.active {
  border-color: var(--primary-deep);
  background: var(--primary);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 2px 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.store-list,
.claim-list {
  display: grid;
  gap: 10px;
}

.store-card,
.detail-card,
.offer-card,
.claim-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(32, 33, 36, 0.04);
}

.store-card {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  padding: 12px;
  text-align: left;
  width: 100%;
  border-color: var(--line);
}

.store-card.placeholder {
  opacity: 0.64;
}

.logo-box {
  width: 66px;
  height: 66px;
  border-radius: 8px;
  background: #fff5cc;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  color: #8a5a00;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-main {
  min-width: 0;
}

.store-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.store-title strong {
  font-size: 17px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff3bf;
  color: #7a4b00;
  padding: 3px 8px;
  font-size: 12px;
}

.meta,
.desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.deal-line {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-tag {
  color: var(--accent);
  font-weight: 800;
}

.ghost-button {
  border: 0;
  background: transparent;
  padding: 10px 2px;
  color: var(--muted);
}

.ghost-panel-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 11px 12px;
  background: #fffdf7;
  color: #7a4b00;
  font-weight: 800;
}

.detail-card {
  padding: 14px;
  margin-bottom: 12px;
}

.detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.detail-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.info-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.info-row strong {
  color: var(--text);
}

.info-row a {
  color: #0b68d8;
  text-decoration: none;
}

.offer-card {
  padding: 14px;
  margin-bottom: 10px;
}

.offer-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.rules {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f5ef;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.5;
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  margin-top: 12px;
  padding: 13px 14px;
  background: var(--primary);
  color: #211700;
  font-weight: 800;
}

.primary-button:disabled {
  background: #e8e8e3;
  color: #8b8b84;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review {
  padding: 10px;
  border-radius: 8px;
  background: #f8f8f6;
  color: #4a4a4a;
  line-height: 1.45;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.review-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}

.profile-card {
  padding: 18px;
  margin: 4px 0 14px;
  background: #222;
  color: #fff;
}

.profile-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 38px;
}

.profile-card small {
  color: #d9d9d9;
}

.empty-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.empty-panel h2 {
  margin: 0;
  font-size: 22px;
}

.empty-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.claim-card {
  padding: 12px;
}

.claim-list-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.claim-card strong {
  display: block;
  font-size: 16px;
}

.list-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
}

.text-button {
  border: 0;
  border-radius: 8px;
  background: #fff3bf;
  color: #7a4b00;
  padding: 8px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.redeem-link {
  display: block;
  margin-top: 10px;
  border-radius: 8px;
  padding: 10px;
  background: #f3f7ff;
  color: #0b68d8;
  text-decoration: none;
  word-break: break-all;
}

.coupon-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.coupon-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.coupon-status {
  display: inline-block;
  margin: 10px 0 14px;
  border-radius: 999px;
  background: #fff3bf;
  color: #7a4b00;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 13px;
}

.qr-image {
  display: block;
  width: min(74vw, 280px);
  height: min(74vw, 280px);
  margin: 0 auto 10px;
  border: 10px solid #fff;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(32, 33, 36, 0.12);
}

.stamp-card {
  display: grid;
  place-items: center;
  width: min(74vw, 280px);
  height: min(48vw, 180px);
  margin: 0 auto 10px;
  border: 2px solid #d6d6d0;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    #f1f1ed,
    #f1f1ed 10px,
    #e7e7e0 10px,
    #e7e7e0 20px
  );
  color: #2f3337;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0;
}

.stamp-card.expired {
  color: #8a1f11;
}

.mini-qr {
  display: block;
  width: 132px;
  height: 132px;
  margin: 12px auto 2px;
  border: 6px solid #fff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(32, 33, 36, 0.08);
}

.claim-number {
  color: var(--muted);
  font-size: 13px;
}

.coupon-card p {
  margin: 10px 0 0;
  line-height: 1.5;
}

.body-text {
  margin: 0;
  color: #404246;
  line-height: 1.65;
}

.coupon-hint {
  color: var(--muted);
  font-size: 14px;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-item {
  padding: 10px;
  border-radius: 8px;
  background: #f8f8f6;
}

.notice-item strong {
  display: block;
  margin-bottom: 5px;
}

.notice-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flow-list {
  margin: 0;
  padding-left: 22px;
  color: #404246;
  line-height: 1.7;
}

.redeemed-box {
  margin-top: 10px;
  border-radius: 8px;
  padding: 10px;
  background: #edf8f3;
  color: #116149;
  line-height: 1.5;
  font-size: 13px;
}

.small-button {
  margin-top: 10px;
  padding: 10px 12px;
}

.review-entry {
  margin: 0 0 14px;
}

.mall-entry {
  margin: 0 0 10px;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 13px;
}

#reviewPanel select,
#reviewPanel textarea,
#reviewPanel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

#reviewPanel textarea {
  min-height: 120px;
  resize: vertical;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.38);
}

.modal.show {
  display: grid;
}

.modal-card {
  width: min(100%, 360px);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.modal-card h3 {
  margin: 0 0 8px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.ghost-action,
.primary-action {
  border: 0;
  border-radius: 8px;
  padding: 11px;
  font-weight: 800;
}

.ghost-action {
  background: #f1f2f4;
  color: var(--text);
}

.primary-action {
  background: var(--primary);
  color: #211700;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px 18px max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.nav-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px 6px;
  color: var(--muted);
}

.nav-item.active {
  color: #211700;
  background: var(--primary);
  font-weight: 800;
}

.nav-item span,
.nav-item em {
  display: block;
  font-style: normal;
}

.nav-item span {
  font-size: 20px;
}

.nav-item em {
  margin-top: 2px;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 86px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: rgba(32, 33, 36, 0.94);
  color: #fff;
  padding: 12px 14px;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 720px) {
  .store-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
