/* 基本設定 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #3f3c58;
  font-family:
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #e3f5ff 0, transparent 35%),
    radial-gradient(circle at 90% 15%, #f8e4ff 0, transparent 30%),
    radial-gradient(circle at 50% 100%, #fff0db 0, transparent 35%),
    #ffffff;
}

/* ページ全体 */
.app {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 48px 20px;
}

/* スタート画面 */
.start-screen {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

/* ロゴ */
.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 62px;
  margin: 0 auto 14px;
  color: #ffffff;
  font-size: 24px;
  background: linear-gradient(135deg, #72d5f5, #a992f7);
  border-radius: 26px;
  box-shadow: 0 10px 28px rgba(126, 170, 238, 0.3);
}

.logo::after {
  position: absolute;
  bottom: -7px;
  left: 15px;
  width: 18px;
  height: 18px;
  content: "";
  background: #7fc9f4;
  border-radius: 0 0 0 6px;
  transform: rotate(25deg);
}

/* ブランド名 */
.brand-name {
  margin: 0 0 12px;
  color: #756bd7;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* メインコピー */
h1 {
  margin: 0 0 34px;
  color: #35324c;
  font-size: clamp(34px, 8vw, 50px);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

/* 練習カード */
.practice-card {
  padding: 32px 28px 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #edf0f8;
  border-radius: 28px;
  box-shadow: 0 18px 55px rgba(82, 92, 136, 0.13);
}

.card-label {
  display: inline-block;
  margin: 0 0 12px;
  padding: 7px 15px;
  color: #7167cb;
  font-size: 13px;
  font-weight: 700;
  background: #f0edff;
  border-radius: 999px;
}

.practice-card h2 {
  margin: 0 0 14px;
  color: #35324c;
  font-size: 28px;
}

.practice-card > p:not(.card-label):not(.note) {
  margin: 0 0 26px;
  color: #6c6980;
  font-size: 16px;
  line-height: 1.8;
}

/* 練習開始ボタン */
button {
  width: 100%;
  padding: 17px 24px;
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #68ccef, #9a82ed);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(117, 139, 225, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover {
  box-shadow: 0 13px 28px rgba(117, 139, 225, 0.4);
  transform: translateY(-2px);
}

button:active {
  box-shadow: 0 6px 16px rgba(117, 139, 225, 0.25);
  transform: translateY(1px);
}

/* 補足表示 */
.note {
  margin: 15px 0 0;
  color: #9995a7;
  font-size: 12px;
}

/* スマートフォン表示 */
@media (max-width: 600px) {
  .app {
    padding: 30px 16px;
  }

  h1 {
    margin-bottom: 26px;
  }

  .practice-card {
    padding: 27px 20px 22px;
    border-radius: 24px;
  }
}

/* 非表示の画面 */
[hidden] {
  display: none !important;
}

/* ヒアリング画面 */
.hearing-screen {
  width: 100%;
  max-width: 620px;
}

/* 画面上部 */
.screen-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 38px;
  text-align: left;
}

.mini-logo {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 50px;
  height: 44px;
  color: #ffffff;
  font-size: 16px;
  background: linear-gradient(135deg, #72d5f5, #a992f7);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(126, 170, 238, 0.25);
}

.mini-logo::after {
  position: absolute;
  bottom: -5px;
  left: 10px;
  width: 13px;
  height: 13px;
  content: "";
  background: #7fc9f4;
  border-radius: 0 0 0 4px;
  transform: rotate(25deg);
}

.mini-brand {
  margin: 0 0 3px;
  color: #7167cb;
  font-size: 15px;
  font-weight: 700;
}

.mode-name {
  margin: 0;
  color: #777388;
  font-size: 13px;
}

/* 進み具合 */
.progress-area {
  margin-bottom: 22px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #777388;
  font-size: 13px;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: #eaeaf3;
  border-radius: 999px;
}

.progress-fill {
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, #6fcff0, #a087ef);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* 質問カード */
.hearing-card {
  padding: 34px;
  text-align: left;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #edf0f8;
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(82, 92, 136, 0.13);
}

.ai-label {
  display: inline-block;
  margin: 0 0 15px;
  padding: 6px 13px;
  color: #7167cb;
  font-size: 12px;
  font-weight: 700;
  background: #f0edff;
  border-radius: 999px;
}

.hearing-card h2 {
  margin: 0 0 10px;
  color: #35324c;
  font-size: 25px;
  line-height: 1.5;
}

.question-help {
  margin: 0 0 25px;
  color: #898597;
  font-size: 14px;
}

/* 選択肢 */
.answer-options {
  display: grid;
  gap: 12px;
}

.answer-button {
  padding: 15px 18px;
  color: #55516c;
  font-size: 15px;
  text-align: left;
  background: #ffffff;
  border: 2px solid #e8e7f1;
  border-radius: 14px;
  box-shadow: none;
}

.answer-button:hover {
  color: #6259bc;
  background: #f8f6ff;
  border-color: #aaa0ed;
  box-shadow: none;
  transform: translateY(-1px);
}

/* 戻るボタン */
.back-button {
  display: block;
  width: auto;
  margin: 22px auto 0;
  padding: 10px 18px;
  color: #777388;
  font-size: 13px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.back-button:hover {
  color: #6259bc;
  box-shadow: none;
}

/* ヒアリング画面のスマートフォン表示 */
@media (max-width: 600px) {
  .screen-header {
    margin-bottom: 28px;
  }

  .hearing-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .hearing-card h2 {
    font-size: 21px;
  }
}

/* 作戦会議画面 */
.strategy-screen {
  width: 100%;
  max-width: 680px;
}

.step-badge {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 8px 16px;
  color: #4c8270;
  font-size: 13px;
  font-weight: 700;
  background: #e5f7ef;
  border-radius: 999px;
}

.strategy-card {
  padding: 34px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #edf0f8;
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(82, 92, 136, 0.13);
}

.strategy-card h2 {
  margin: 0 0 10px;
  color: #35324c;
  font-size: 26px;
  line-height: 1.5;
}

.strategy-intro {
  margin: 0 0 26px;
  color: #817d90;
  font-size: 14px;
  line-height: 1.8;
}

/* 回答内容 */
.answer-summary {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
  overflow: hidden;
  background: #fafafe;
  border: 1px solid #e9e8f1;
  border-radius: 17px;
}

.answer-summary div {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 15px;
  padding: 14px 18px;
  border-bottom: 1px solid #e9e8f1;
}

.answer-summary div:last-child {
  border-bottom: 0;
}

.answer-summary dt {
  color: #8a8698;
  font-size: 13px;
  font-weight: 700;
}

.answer-summary dd {
  margin: 0;
  color: #4f4b65;
  font-size: 14px;
  font-weight: 700;
}

/* 練習のポイント */
.strategy-tip {
  margin-bottom: 25px;
  padding: 18px 20px;
  color: #57526e;
  background: linear-gradient(135deg, #eef9ff, #f5efff);
  border-radius: 17px;
}

.tip-title {
  margin: 0 0 7px;
  color: #6c62c4;
  font-size: 14px;
  font-weight: 700;
}

.strategy-tip p:last-child {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}

/* 作戦会議画面のスマートフォン表示 */
@media (max-width: 600px) {
  .strategy-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .strategy-card h2 {
    font-size: 22px;
  }

  .answer-summary div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* ロールプレイ画面 */
.roleplay-screen {
  width: 100%;
  max-width: 720px;
}

.roleplay-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: #5d596e;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  background: #58c998;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(88, 201, 152, 0.15);
}

.finish-button {
  width: auto;
  padding: 8px 13px;
  color: #7b7689;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid #e2e0e9;
  border-radius: 10px;
  box-shadow: none;
}

.finish-button:hover {
  color: #d06472;
  background: #fff5f6;
  border-color: #efc7cd;
  box-shadow: none;
}

/* 相手役の表示 */
.roleplay-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
  color: #777286;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #ebeaf1;
  border-radius: 14px;
}

.roleplay-info p {
  margin: 0;
}

.roleplay-info strong {
  color: #4e4a63;
}

.roleplay-info span {
  margin-left: auto;
  color: #756bd7;
  font-weight: 700;
}

/* チャット全体 */
.chat-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #ecebf3;
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(82, 92, 136, 0.13);
}

.chat-messages {
  min-height: 300px;
  max-height: 430px;
  padding: 26px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(248, 250, 255, 0.85), rgba(253, 249, 255, 0.85));
}

/* メッセージ */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 22px;
}

.avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #665db7;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #dff5ff, #eee5ff);
  border-radius: 15px;
}

.message-content {
  max-width: 78%;
}

.speaker-name {
  margin: 0 0 6px;
  color: #8b8798;
  font-size: 12px;
}

.message-bubble {
  padding: 13px 16px;
  color: #4d4961;
  font-size: 14px;
  line-height: 1.7;
  border-radius: 6px 17px 17px 17px;
}

.ai-bubble {
  background: #ffffff;
  border: 1px solid #e7e6ef;
}

/* ユーザー側のメッセージ */
.user-message-row {
  justify-content: flex-end;
}

.user-message-row .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-bubble {
  color: #ffffff;
  background: linear-gradient(135deg, #72caed, #9481e9);
  border-radius: 17px 6px 17px 17px;
}

/* 入力部分 */
.input-area {
  padding: 20px;
  background: #ffffff;
  border-top: 1px solid #ecebf3;
}

.input-area label {
  display: block;
  margin-bottom: 9px;
  color: #625e73;
  font-size: 13px;
  font-weight: 700;
}

.input-area textarea {
  width: 100%;
  min-height: 82px;
  margin-bottom: 11px;
  padding: 13px 15px;
  color: #454157;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  background: #fbfbfe;
  border: 2px solid #e7e6ef;
  border-radius: 13px;
  outline: none;
}

.input-area textarea:focus {
  background: #ffffff;
  border-color: #a99dec;
  box-shadow: 0 0 0 4px rgba(169, 157, 236, 0.12);
}

.input-area textarea::placeholder {
  color: #aaa6b5;
}

.roleplay-note {
  margin: 16px 0 0;
  color: #8b8798;
  font-size: 12px;
  text-align: center;
}

/* ロールプレイ画面のスマートフォン表示 */
@media (max-width: 600px) {
  .roleplay-info {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .roleplay-info span {
    width: 100%;
    margin-left: 0;
  }

  .chat-messages {
    min-height: 260px;
    padding: 20px 15px;
  }

  .message-content {
    max-width: 82%;
  }

  .input-area {
    padding: 16px;
  }
}

/* 振り返り画面 */
.feedback-screen {
  width: 100%;
  max-width: 680px;
}

.feedback-card {
  padding: 34px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #ecebf3;
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(82, 92, 136, 0.13);
}

.feedback-card h2 {
  margin: 0 0 10px;
  color: #35324c;
  font-size: 26px;
  line-height: 1.5;
}

.feedback-intro {
  margin: 0 0 24px;
  color: #817d90;
  font-size: 14px;
  line-height: 1.8;
}

.feedback-content {
  display: grid;
  gap: 15px;
  margin-bottom: 25px;
}

.feedback-item {
  padding: 19px 20px;
  border-radius: 17px;
}

.feedback-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.feedback-item p:last-child {
  margin: 0;
  color: #57526e;
  font-size: 14px;
  line-height: 1.8;
}

.good-point {
  background: #ecfaf4;
  border-left: 5px solid #62c99e;
}

.good-point .feedback-title {
  color: #318367;
}

.improvement-point {
  background: #fff8e9;
  border-left: 5px solid #e5b95e;
}

.improvement-point .feedback-title {
  color: #9a7122;
}

.example-point {
  background: linear-gradient(135deg, #eef9ff, #f5efff);
  border-left: 5px solid #8d82dd;
}

.example-point .feedback-title {
  color: #665bc2;
}

.feedback-error {
  margin: 0 0 22px;
  padding: 15px 17px;
  color: #b05763;
  font-size: 14px;
  line-height: 1.7;
  background: #fff1f3;
  border-radius: 14px;
}

.feedback-actions {
  display: grid;
  gap: 12px;
}

.feedback-actions .back-button {
  width: 100%;
  margin: 0;
}

/* 振り返り画面のスマートフォン表示 */
@media (max-width: 600px) {
  .feedback-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .feedback-card h2 {
    font-size: 22px;
  }

  .feedback-item {
    padding: 17px;
  }
}

/* 入力時の安全注意書き */
.input-safety-note {
  margin: -3px 0 12px;
  color: #8b8798;
  font-size: 12px;
  line-height: 1.6;
}