* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #111827;
  background-color: #d9d9d9;
}

a {
  color: inherit;
}

.page-wrapper {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.content-shell {
  width: 100%;
  max-width: 384px;
  margin: 0;
  margin-top: 0;
  background-image: url("/assets/backgrounds/back-ground.png");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: top center;
  padding: 0;
  padding-bottom: 0;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(88, 28, 135, 0.12);
}

.content-shell--result {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-section {
  padding: 0 20px;
}

.header-banner {
  position: relative;
  width: 100%;
  height: 60px;
  margin: 0;
  margin-top: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-banner img {
  width: 38px;
  height: 36px;
  object-fit: contain;
}

.main-visual {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.lead-text {
  text-align: center;
  color: #6b2f7c;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
  margin: 28px 0 0;
}

.lead-text-note {
  text-align: center;
  color: #111827;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.campaign-info {
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid #b18ae6;
  border-bottom: 1px solid #b18ae6;
  padding: 16px 20px;
  margin: 0 20px 36px;
}

.campaign-info__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #5c2871;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.campaign-info__date {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.layout-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.sub-visual {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: contain;
  vertical-align: bottom;
  line-height: 0;
  font-size: 0;
  flex-shrink: 0;
}

.selection-heading {
  width: 100%;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0;
  background-color: #7151b8;
  color: #fff;
  text-align: center;
  padding: 20px 0;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 0 20px;
  margin-top: 20px;
}

.choice-card {
  position: relative;
  border: 4px solid transparent;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(79, 70, 229, 0.08);
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.choice-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.choice-card:hover,
.choice-card:focus-visible {
  transform: translateY(-3px);
}

.choice-card.selected {
  border-color: #c084fc;
  box-shadow: 0 10px 22px rgba(168, 85, 247, 0.22);
}

.choice-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #a855f7;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 10px rgba(168, 85, 247, 0.45);
}

.choice-card.selected .choice-card__badge {
  display: flex;
}

.actions {
  padding: 36px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.actions button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.actions button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.footer {
  margin: 32px 0 0;
  margin-bottom: 0;
  background: #fff;
  padding: 16px;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.footer a {
  text-decoration: underline;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.footer__note {
  letter-spacing: 0.08em;
}

/* Result page */

.result-preview {
  position: relative;
  width: 100%;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 24px;
  background: transparent;
}

.result-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 生成されたOGP画像が単独で表示される場合 */
.result-preview > img:only-child {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.result-preview__frame {
  object-fit: contain;
  pointer-events: none;
}

.result-preview__pair {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6%;
  padding: 0 8%;
}

.result-preview__pair img {
  position: relative;
  width: 35%;
  height: auto;
}

.result-preview__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed rgba(107, 114, 128, 0.6);
  color: #4b5563;
  font-size: 13px;
  line-height: 1.6;
}

.result-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px 32px;
}

.result-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  padding: 24px 20px 0;
}

.content-shell--result .footer {
  margin-top: 24px;
}

.result-actions a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 330px;
}

.result-actions a img {
  width: 100%;
  height: auto;
  max-width: 330px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .page-wrapper {
    padding: 0 32px;
  }

  .content-shell {
    max-width: 630px;
  }

  .selection-heading {
    margin-top: 40px;
  }

  .actions {
    padding-top: 44px;
  }
}
