:root {
  --bg: #f2f2f2;
  --red: #e60012;
  --red-dark: #c40010;
  --text: #222;
  --muted: #666;
  --line: #d9d9d9;
  --panel: #fff;
  --header: #111;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; }

.header {
  background: #fff;
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.hero-label {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 4px 0 8px;
}

.hero-text { color: var(--muted); font-size: 14px; }

.block-head {
  margin-bottom: 12px;
}

.block-head h2,
.apply h2 {
  font-size: 18px;
  font-weight: 900;
  padding-left: 10px;
  border-left: 4px solid var(--red);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  height: 100%;
}

.card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  height: 100%;
}

.card:hover { border-color: #bbb; }

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #e8e8e8;
  overflow: hidden;
}

.cover img,
.cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.is-logo {
  background: #fff;
}

.cover.is-logo img {
  object-fit: contain;
  padding: 18%;
}

.cover.is-photo img {
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  font-size: 48px;
  color: #9a9a9a;
  background: linear-gradient(180deg, #ececec, #d8d8d8);
}

.no,
.stamp {
  position: absolute;
  top: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
}

.no {
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.stamp {
  right: 8px;
  background: var(--red);
  color: #fff;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.maker {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 1.3em;
}

.card-body h3 {
  font-size: 16px;
  margin: 4px 0 0;
  min-height: 2.8em;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc {
  color: var(--muted);
  font-size: 12px;
  min-height: 2.4em;
}

.buy {
  display: block;
  margin-top: auto;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
}

.card:hover .buy { background: var(--red-dark); }
.buy-short { display: none; }

.apply {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.apply p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.apply-btn {
  flex: 0 0 auto;
  display: inline-block;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 22px;
  min-width: 200px;
  text-align: center;
}

.apply-btn:hover { background: var(--red-dark); }

.footer {
  background: #111;
  color: #ddd;
  padding: 28px 0;
  font-size: 12px;
}

.footer-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.footer-name {
  color: #fff;
  font-weight: 700;
  margin-bottom: 6px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.gate[hidden] { display: none; }

.gate-card {
  width: min(420px, 100%);
  background: #fff;
  border-top: 4px solid var(--red);
  padding: 28px 24px;
  text-align: center;
}

.gate-mark {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

.gate-card h2 { font-size: 22px; margin-bottom: 8px; }
.gate-card p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.gate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  appearance: none;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-yes { background: var(--red); color: #fff; }
.btn-no { background: #eee; color: #333; }

@media (max-width: 720px) {
  .header-inner {
    width: min(1080px, calc(100% - 16px));
    min-height: 48px;
  }
  .logo { font-size: 15px; }
  .main {
    width: min(1080px, calc(100% - 16px));
    padding: 12px 0 20px;
  }
  .hero { padding: 10px 12px; margin-bottom: 10px; }
  .hero-label { font-size: 10px; }
  .hero h1 { font-size: 17px; margin: 2px 0 4px; }
  .hero-text { font-size: 12px; }
  .block-head { margin-bottom: 8px; }
  .block-head h2,
  .apply h2 { font-size: 14px; padding-left: 8px; border-left-width: 3px; }
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .cover { aspect-ratio: 1 / 1; }
  .cover.is-logo img { padding: 10%; }
  .card-body { padding: 7px 6px 8px; }
  .maker { font-size: 10px; min-height: 2.6em; }
  .card-body h3 {
    font-size: 12px;
    margin: 2px 0 0;
    line-height: 1.3;
    min-height: 2.6em;
  }
  .desc { display: none; }
  .buy { margin-top: auto; font-size: 11px; padding: 7px 4px; }
  .buy-full { display: none; }
  .buy-short { display: inline; }
  .apply {
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
    padding: 12px;
    gap: 10px;
  }
  .apply p { font-size: 12px; }
  .apply-btn { min-width: 0; width: 100%; padding: 10px 12px; }
  .footer { padding: 16px 0; }
  .footer-inner { width: min(1080px, calc(100% - 16px)); }
}

@media (min-width: 721px) and (max-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
