/* #あなたへのカード — Palmu 4周年
   カード本体の淡いパステルに寄せた、スマホ主体のシンプルな1枚もの UI。 */

:root {
  --bg: #eaf6ff;
  --bg-accent: #f4ecff;
  --panel: #ffffff;
  --ink: #3f4a63;
  --ink-soft: #7b87a3;
  --line: #dfe8f6;
  --brand: #6d6de0;
  --brand-deep: #4f4fc4;
  --radius: 20px;
  --shadow: 0 12px 30px rgba(94, 122, 168, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--ink);
  font-family: "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Noto Sans JP", sans-serif;
  font-weight: 500;
  line-height: 1.7;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 55%, #fdf7ff 100%);
  background-attachment: fixed;
  min-height: 100dvh;
}

/* ---------- hero ---------- */

.hero {
  padding: 28px 20px 8px;
  text-align: center;
}

.hero__eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.hero__title {
  margin: 4px 0 10px;
  font-size: clamp(26px, 7.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(92deg, #6d6de0 0%, #4aa8d8 52%, #57c8b5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- layout ---------- */

.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 0;
}

/* ---------- preview ---------- */

.preview__frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  line-height: 0;
}

#card {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- editor ---------- */

.editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 18px 22px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.field__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px; /* iOS の自動ズーム回避のため 16px 以上 */
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  background: #f9fbff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  resize: vertical;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #b6c1d6;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #a9b6ff;
  background: #fff;
}

/* ---------- chips / swatches ---------- */

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.chip {
  padding: 10px 6px 11px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  background: #f9fbff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chips--three {
  grid-template-columns: repeat(3, 1fr);
}

.chip--plain {
  padding: 13px 6px;
  font-weight: 700;
}

.chip[aria-checked="true"] {
  border-color: var(--brand);
  background: #f1f1ff;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.chip__sample {
  display: block;
  font-size: 17px;
}

.chip__name {
  display: block;
  margin-top: 2px;
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: 11px;
  color: var(--ink-soft);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.swatch {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--line);
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.swatch[aria-checked="true"] {
  box-shadow: 0 0 0 2.5px var(--brand);
  transform: scale(1.06);
}

.custom-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
}

.custom-color input[type="color"] {
  width: 40px;
  height: 30px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
  margin: 20px auto 0;
  padding: 0 16px;
}

.btn {
  width: 100%;
  padding: 15px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(92deg, #6d6de0 0%, #4aa8d8 100%);
  box-shadow: 0 8px 20px rgba(109, 109, 224, 0.28);
}

.btn--ghost {
  color: var(--brand-deep);
  background: #fff;
  border: 1.5px solid #cdd6ff;
}

.btn--text {
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
}

.actions__note {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- footer ---------- */

.foot {
  max-width: 560px;
  margin: 26px auto 0;
  padding: 0 20px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: center;
}

.foot p {
  margin: 0;
}

.foot__tags {
  margin-top: 6px;
  color: var(--brand);
  font-weight: 700;
}

/* ---------- 広い画面では左右 2 カラム ---------- */

@media (min-width: 900px) {
  .layout {
    flex-direction: row;
    align-items: flex-start;
    max-width: 1040px;
    gap: 24px;
  }

  .preview {
    position: sticky;
    top: 20px;
    flex: 1 1 46%;
  }

  .editor {
    flex: 1 1 54%;
  }

  .actions {
    max-width: 1040px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .actions .btn {
    width: auto;
    min-width: 240px;
  }

  .actions__note,
  .actions .btn--text {
    width: 100%;
  }
}
