:root {
  --page: #f3f3f5;
  --card: #ffffff;
  --wine: #8e1b2b;
  --red: #d21e3c;
  --ink: #1c1c1c;
  --muted: #8a8a8a;
  --line: #ececee;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

.sheet {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--card);
}

.mast {
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: var(--wine);
  color: #fff;
  text-align: center;
}

.mast h1 {
  margin: 0;
  font-size: clamp(1.15rem, 5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

main {
  padding: 0;
}

.coupons {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coupon {
  display: grid;
  grid-template-columns: 28px 92px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.coupon:last-child { border-bottom: 0; }

.place {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.logo {
  display: grid;
  width: 92px;
  height: 40px;
  place-items: center;
  text-decoration: none;
}

.logo img {
  width: auto;
  height: auto;
  max-width: 88px;
  max-height: 34px;
  object-fit: contain;
  object-position: center;
}

.info {
  min-width: 0;
}

.logo:focus-visible,
.go:focus-visible,
.base a:focus-visible {
  outline: 3px solid rgba(210, 30, 60, 0.4);
  outline-offset: 3px;
}

.tag {
  margin: 0;
  color: var(--wine);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sum {
  margin: 0;
  color: var(--wine);
  font-size: clamp(1.05rem, 4.2vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.action {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.stars {
  display: flex;
  gap: 1px;
  color: #e3d4d6;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
}

.stars .on { color: var(--red); }

.go {
  display: inline-flex;
  min-height: 34px;
  width: max-content;
  min-width: 96px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.go:hover { filter: brightness(1.06); }

.base {
  padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.base > p {
  margin: 6px 4px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.base nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.base a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.base a span:last-child {
  color: var(--red);
  font-size: 1.3rem;
}

.doc main {
  width: min(100%, 720px);
  padding: 18px 16px 24px;
}

.doc article {
  padding: 8px 4px 20px;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.55;
}

.doc h2 {
  margin: 22px 0 8px;
  color: var(--wine);
  font-size: 1.1rem;
}

.doc h2:first-child { margin-top: 0; }

.doc a { color: var(--red); font-weight: 700; }

.warn {
  margin: 18px 0;
  padding: 14px;
  border-radius: 12px;
  background: #fde8ec;
}

@media (max-width: 399px) {
  .coupon {
    grid-template-columns: 24px 72px minmax(0, 1fr) auto;
    column-gap: 6px;
    padding: 10px;
  }

  .note { display: none; }

  .place {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .logo {
    width: 72px;
    height: 34px;
  }

  .logo img {
    max-width: 70px;
    max-height: 28px;
  }

  .sum { font-size: 1rem; }

  .action { gap: 4px; }

  .go {
    min-width: 0;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .stars { font-size: 0.7rem; }
}

@media (min-width: 768px) {
  body { padding: 20px 16px; }
  .sheet {
    min-height: auto;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(20, 16, 18, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
