* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f7f7;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

.app {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 30px 20px 50px;
  text-align: center;
}

.progress {
  font-size: 12px;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 20px;
}

h1 {
  margin: 10px 0 25px;
  letter-spacing: 3px;
  line-height: 1.3;
}

.title-jp {
  display: block;
  font-size: 26px;
}

.title-kr {
  display: block;
  font-size: 19px;
  margin-top: 5px;
}

#groupName {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 0 3px;
}

.question {
  font-size: 14px;
  color: #777;
  margin-bottom: 25px;
}

#members {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 10px;
}

.member {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
}

.member img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.member-name {
  padding: 10px 5px;
  font-size: 14px;
  font-weight: bold;
}

.member.selected {
  border: 2px solid #222;
  transform: scale(0.97);
}

.next-button {
  display: none;
  width: 100%;
  margin-top: 25px;
  padding: 15px;
  border: none;
  border-radius: 30px;
  background: #222;
  color: white;
  font-size: 15px;
  font-weight: bold;
}

.next-button:active {
  transform: scale(0.98);
}

.back-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  background: transparent;
  color: #777;
  font-size: 14px;
}

.back-button:active {
  opacity: 0.5;
}


/* 結果画面 */

.result-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}

.result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.result-group {
  margin-top: 3px;
  padding-bottom: 12px;
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
}

.result-name {
  padding: 5px 10px 0;
  font-size: 20px;
  font-weight: bold;
}

.skip-button {
  display: block;
  width: 180px;
  margin: 20px auto 0;
  padding: 10px 15px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: white;
  color: #888;
  font-size: 14px;
}

.skip-button:active {
  opacity: 0.5;
}

.back-button {
  display: block;
  width: 180px;
  margin: 10px auto 0;
  padding: 10px 15px;
  border: none;
  background: transparent;
  color: #777;
  font-size: 14px;
}

/* =====================
   結果画面のボタン
   ===================== */

.result-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 30px;
}

.result-button {
  height: 48px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.save-button {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #222;
}

.x-button {
  border: 1px solid #222;
  background: #000;
  color: #fff;
}

.restart-button {
  grid-column: 1 / 3;
  width: 180px;
  justify-self: center;
  border: 1px solid #e0e0e0;
  background: #f1f1f1;
  color: #222;
}

.result-button:active {
  opacity: 0.7;
  transform: scale(0.98);
}

.x-logo {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
}


/* ==================================================
   結果画面のレイアウト調整
   ================================================== */

/* レイアウト変更ボタンを少し上へ */
.result-layout-buttons {
  margin-top: 10px !important;
}

/* メンバー写真と名前を近づける */
.result-row > div > div:nth-child(2) {
  margin-top: 3px !important;
}

/* メンバー名とグループ名を近づける */
.result-row > div > div:nth-child(3) {
  margin-top: 0 !important;
}

/* 行と行の間を少し狭く */
.result-row {
  margin-bottom: 4px !important;
}