/* ========================================
   MOYATTY Cards
   Card UI Style

   このファイルはカード専用CSS。
   new_ui3.css にはカードCSSを追加しない。
======================================== */

.moyatty-card-stage {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.moyatty-card {
  width: min(92vw, 420px);
  border-radius: 24px;
}

.moyatty-card-stage {
  background: #fffaf7;
  z-index: 9999;
  padding: 24px;
  box-sizing: border-box;
}

.moyatty-card {
  background: #ffffff;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(80, 60, 50, 0.14);
}

.moyatty-card-title {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
}

.moyatty-card-actions {
  display: grid;
  gap: 14px;
}

.moyatty-card-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  background: #f6efe9;
}

/* card stage hidden fix */
.moyatty-card-stage.hidden {
  display: none !important;
}

/* ========================================
   Mode Choice
======================================== */

.mode-choice-page {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.mode-choice-title {
  display: block;
  width: min(92%, 520px);
  margin: 0 auto 24px;
}

.mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.mode-choice-card-button {
  position: relative;
  display: block;

  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  appearance: none;
  transition: transform .15s ease;
}

.mode-choice-card-button:hover {
  transform: translateY(-2px);
}

.mode-choice-card-button:active {
  transform: scale(.98);
}

.mode-choice-card-img {
  display: block;
  width: 100%;
}

.mode-choice-action-wrap {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 4%;
  margin: 0;
  pointer-events: none;
}

.mode-choice-action-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.mode-choice-action-text {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  margin: 0;
  padding-left: 12%;

  color: #ffffff;
  font-size: clamp(12px, 2.8vw, 18px);
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

.mode-choice-card-role {
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  margin: 0;

  font-size: clamp(18px, 4vw, 28px);
  line-height: 1.2;
  font-weight: 800;
  color: #0b2d5c;
  text-align: center;
  pointer-events: none;
}

.mode-choice-footer {
  display: block;
  width: min(100%, 580px);
  margin: 0 auto;
}

@media (max-width: 700px) {

  .mode-choice-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mode-choice-card-img {
    width: 100%;
    margin: 0 auto;
  }

  .mode-choice-action-img {
    width: 100%;
  }

  .mode-choice-title,
  .mode-choice-footer {
    width: 95%;
  }

}

.mode-choice-title-wrap {
  position: relative;
  width: min(92%, 520px);
  margin: 0 auto 24px;
}

.mode-choice-title-wrap .mode-choice-title {
  width: 100%;
  margin: 0;
}

.mode-choice-title-text {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  transform: translateY(-22px);

  margin: 0;

  font-size: clamp(34px, 7vw, 54px);

  font-weight: 800;

  color: #0b2d5c;
}

.mode-choice-subtitle {
  margin: -50px auto 22px;
  font-size: clamp(14px, 2.8vw, 18px);
  line-height: 1.5;
  font-weight: 700;
  color: #0b2d5c;
  text-align: center;
}

.mode-choice-card-name-wrap {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  margin: 0;
  pointer-events: none;
}

.mode-choice-name-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.mode-choice-card-name {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  margin: 0;
  color: #ffffff;
  font-size: clamp(13px, 3.2vw, 20px);
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

.mode-choice-card-text {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 72%;

  margin: 0;

  white-space: pre-line;
  text-align: center;

  font-size: clamp(12px, 2.3vw, 16px);
  line-height: 1.32;
  font-weight: 700;
  color: #0b2d5c;

  pointer-events: none;
}

.mode-choice-version {
  margin: 4px auto 0;
  font-size: clamp(10px, 2vw, 13px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(11, 45, 92, 0.45);
  text-align: center;
}


/* ========================================
   Card Catalog Code
======================================== */

.card-code {
  margin: 0;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.card-code--reference {
  position: absolute;
  right: 8px;
  bottom: -18px;
  font-size: clamp(10px, 2vw, 12px);
  color: rgba(11, 45, 92, 0.35);
}


.card-code--important {
  display: block;
  margin: 16px auto 0;
  font-size: clamp(20px, 5vw, 28px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #1f1f1f;
}


/* ========================================
   Message Card
======================================== */

.message-card {
  width: min(92vw, 420px);
  min-height: min(88vh, 720px);
  margin: 0 auto;
  padding: 44px 24px 28px;
  box-sizing: border-box;
  border-radius: 28px;
  text-align: center;
  background: #bfded9;
  color: #2b2b2b;
}

.message-card-title {
  margin: 0 0 32px;
  font-size: clamp(26px, 6.1vw, 36px);
  line-height: 1.2;
  font-weight: 500;
}

.message-card-body {
  margin: 0 auto 24px;
  white-space: pre-line;
  font-size: clamp(21px, 5.1vw, 30px);
  line-height: 1.35;
  font-weight: 800;
}

.message-card-sub-body {
  margin: 0 auto 18px;
  white-space: pre-line;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.35;
  font-weight: 500;
  color: rgba(43, 43, 43, 0.45);
}

.message-card-actions {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 18px auto 0;
}

.message-card-button {
  min-width: min(70vw, 224px);
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
}

.message-card-button--primary {
  background: #ffda55;
  color: #2b2b2b;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.message-card-button--secondary {
  min-height: 38px;
  background: #ffda55;
  color: #2b2b2b;
}

.message-card-button:active {
  transform: translateY(1px);
}

.message-card-button:disabled {
  cursor: default;
  opacity: 0.68;
  transform: none;
}

.message-card-support-form {
  display: grid;
  gap: 12px;
  width: min(100%, 330px);
  margin: 12px auto 18px;
  text-align: left;
}

.message-card-support-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: rgba(43, 43, 43, 0.72);
}

.message-card-support-select,
.message-card-support-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(43, 43, 43, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #2b2b2b;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.message-card-support-select {
  min-height: 42px;
  padding: 8px 10px;
}

.message-card-support-textarea {
  min-height: 78px;
  padding: 10px;
  resize: vertical;
}

.message-card-support-privacy {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  color: rgba(43, 43, 43, 0.52);
  text-align: center;
}

.message-card-support-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(182, 69, 69, 0.12);
  color: #7e3030;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
}

.message-card-code {
  pointer-events: auto;
}

.message-card-footer-img {
  display: block;
  width: min(62vw, 260px);
  height: auto;
  margin: 22px auto 0;
}


/* ========================================
   Message Card Overlay
======================================== */

.message-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  overflow: auto;
  background: rgba(255, 250, 247, 0.72);
  -webkit-overflow-scrolling: touch;
}

.message-card-overlay .message-card {
  margin: auto;
}


/* ========================================
   Message Card Theme: Notice
======================================== */

.message-card--notice {
  position: relative;
  overflow: hidden;
}

.message-card--notice::before,
.message-card--notice::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  background: #ff7a00;
  pointer-events: none;
}

.message-card--notice::before {
  top: 0;
}

.message-card--notice::after {
  bottom: 0;
}

.message-card--notice .message-card-title::before {
  content: "⚠️  NOTICE";
  display: block;
  margin: 0 0 40px;
  text-align: left;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ff7a00;
}

.message-card--notice .message-card-footer-img {
  width: min(52vw, 220px);
  margin-top: 30px;
}

.message-card--notice .message-card-code {
  margin-top: 20px;
  font-size: 22px;
  letter-spacing: 0.08em;
}


/* ========================================
   Message Card Theme: Warning
======================================== */

.message-card--warning {
  position: relative;
  overflow: hidden;
}

.message-card--warning::before,
.message-card--warning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  background: #8a4cff;
  pointer-events: none;
}

.message-card--warning::before {
  top: 0;
}

.message-card--warning::after {
  bottom: 0;
}

.message-card--warning .message-card-title::before {
  content: "⚠️  WARNING";
  display: block;
  margin: 0 0 40px;
  text-align: left;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #8a4cff;
}

.message-card--warning .message-card-footer-img {
  width: min(52vw, 220px);
  margin-top: 30px;
}

.message-card--warning .message-card-code {
  margin-top: 20px;
  font-size: 22px;
  letter-spacing: 0.08em;
}


/* ========================================
   Message Card Toast
======================================== */

.message-card-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 10050;
  max-width: min(82vw, 360px);
  padding: 10px 16px;
  border-radius: 999px;
  box-sizing: border-box;
  background: rgba(43, 43, 43, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.message-card-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* ========================================
   D-001-SENT Visual Priority
   - body: received timestamp, smaller/lighter
   - subBody: deadline guidance, more important than timestamp
   - no :has() dependency for Android / older browsers
======================================== */

.message-card--key-d-001-sent .message-card-body {
  margin-bottom: 16px;
  font-size: clamp(13px, 3.2vw, 16px);
  line-height: 1.45;
  font-weight: 500;
  color: rgba(43, 43, 43, 0.52);
}

.message-card--key-d-001-sent .message-card-sub-body {
  margin-bottom: 18px;
  font-size: clamp(18px, 4.6vw, 25px);
  line-height: 1.38;
  font-weight: 700;
  color: rgba(43, 43, 43, 0.78);
}

.message-card--key-d-001-sent .message-card-actions {
  margin-top: 20px;
}


/* ========================================
   D-002: Not enough diary material
   Calm typography and character guidance
======================================== */

.message-card--key-d-002 {
  min-height: 0;
  padding: 38px 24px 26px;
  display: flex;
  flex-direction: column;
}

.message-card--key-d-002 .message-card-title {
  order: 1;
  margin-bottom: 24px;
  font-size: clamp(24px, 5.5vw, 31px);
  line-height: 1.28;
  font-weight: 600;
  white-space: pre-line;
}

.message-card--key-d-002 .message-card-title::before {
  margin-bottom: 28px;
}

.message-card--key-d-002 .message-card-body {
  order: 2;
  margin-bottom: 8px;
  font-size: clamp(18px, 4.4vw, 23px);
  line-height: 1.55;
  font-weight: 600;
}

.message-card--key-d-002 .message-card-footer-img {
  order: 3;
  width: min(44vw, 170px);
  margin: 4px auto 8px;
}

.message-card--key-d-002 .message-card-sub-body {
  order: 4;
  margin-bottom: 14px;
  font-size: clamp(15px, 3.8vw, 19px);
  line-height: 1.55;
  font-weight: 500;
  color: rgba(43, 43, 43, 0.7);
}

.message-card--key-d-002 .message-card-actions {
  order: 5;
  margin-top: 8px;
}

.message-card--key-d-002 .message-card-code {
  order: 6;
  margin-top: 18px;
  font-size: clamp(17px, 4.2vw, 22px);
}

/* ========================================
   D-003: Diary creation rate limit
   Calm waiting guidance
======================================== */

.message-card--key-d-003 {
  min-height: 0;
  padding: 38px 24px 26px;
  display: flex;
  flex-direction: column;
}

.message-card--key-d-003 .message-card-title {
  order: 1;
  margin-bottom: 24px;
  font-size: clamp(24px, 5.5vw, 31px);
  line-height: 1.28;
  font-weight: 600;
  white-space: pre-line;
}

.message-card--key-d-003 .message-card-title::before {
  margin-bottom: 28px;
}

.message-card--key-d-003 .message-card-body {
  order: 2;
  margin-bottom: 8px;
  font-size: clamp(18px, 4.4vw, 23px);
  line-height: 1.55;
  font-weight: 600;
}

.message-card--key-d-003 .message-card-footer-img {
  order: 3;
  width: min(44vw, 170px);
  margin: 4px auto 8px;
}

.message-card--key-d-003 .message-card-sub-body {
  order: 4;
  margin-bottom: 14px;
  font-size: clamp(15px, 3.8vw, 19px);
  line-height: 1.55;
  font-weight: 500;
  color: rgba(43, 43, 43, 0.7);
}

.message-card--key-d-003 .message-card-actions {
  order: 5;
  margin-top: 8px;
}

.message-card--key-d-003 .message-card-code {
  order: 6;
  margin-top: 18px;
  font-size: clamp(17px, 4.2vw, 22px);
}
