* {
  box-sizing: border-box;
}

html {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #222;
}

/* ==============================
   ヘッダー
============================== */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 20px;
}

.site-logo {
  color: #2563eb;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

/* ==============================
   メイン
============================== */

.main-content {
  padding: 40px 16px 60px;
}

.tool-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;

  background: #ffffff;
  border-radius: 16px;

  padding: 32px;

  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* ==============================
   タイトル
============================== */

.tool-heading {
  margin-bottom: 30px;
}

.tool-heading h1 {
  margin: 0 0 12px;

  font-size: 28px;
  line-height: 1.4;
}

.tool-heading p {
  margin: 0;

  color: #666;
  font-size: 15px;
  line-height: 1.8;
}

/* ==============================
   入力欄
============================== */

.input-section {
  margin-bottom: 24px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 10px;
}

.section-title-row label {
  font-weight: 700;
}

.member-count {
  color: #666;
  font-size: 14px;
}

textarea {
  display: block;

  width: 100%;
  min-height: 230px;

  resize: vertical;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  padding: 14px;

  font: inherit;
  font-size: 16px;
  line-height: 1.7;

  outline: none;

  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

textarea:focus {
  border-color: #2563eb;

  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ==============================
   メインボタン
============================== */

.primary-button {
  width: 100%;

  border: none;
  border-radius: 10px;

  padding: 15px 20px;

  background: #2563eb;
  color: #ffffff;

  font-size: 16px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.2s,
    transform 0.1s;
}

.primary-button:hover {
  background: #1d4ed8;
}

.primary-button:active {
  transform: scale(0.99);
}

/* ==============================
   エラー
============================== */

.error-message {
  margin: 14px 0 0;

  padding: 12px 14px;

  border-radius: 8px;

  background: #fef2f2;
  color: #dc2626;

  font-size: 14px;
}

/* ==============================
   結果
============================== */

.result-section {
  margin-top: 32px;

  padding-top: 28px;

  border-top: 1px solid #e5e7eb;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 16px;
}

.result-header h2 {
  margin: 0;

  font-size: 22px;
}

.result-header span {
  color: #666;
  font-size: 14px;
}

/* ==============================
   順番一覧
============================== */

.result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;

  list-style: none;

  margin: 0;
  padding: 0;
}

.result-item {
  display: flex;
  align-items: center;

  min-height: 62px;

  background: #f8fafc;

  border: 1px solid #e5e7eb;
  border-radius: 10px;

  padding: 10px 16px;
}

.rank-number {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  width: 42px;
  height: 42px;

  margin-right: 16px;

  border-radius: 50%;

  background: #2563eb;
  color: #ffffff;

  font-weight: 700;
}

.member-name {
  min-width: 0;

  font-size: 17px;
  font-weight: 700;

  word-break: break-word;
}

/* ==============================
   結果ボタン
============================== */

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 10px;

  margin-top: 20px;
}

.secondary-button,
.reset-button {
  border-radius: 8px;

  padding: 12px 10px;

  font: inherit;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
}

.secondary-button {
  border: 1px solid #2563eb;

  background: #ffffff;
  color: #2563eb;
}

.secondary-button:hover {
  background: #eff6ff;
}

.reset-button {
  grid-column: 1 / -1;

  border: 1px solid #d1d5db;

  background: #ffffff;
  color: #555;
}

.reset-button:hover {
  background: #f3f4f6;
}

/* ==============================
   コピー完了
============================== */

.copy-message {
  margin: 12px 0 0;

  text-align: center;

  color: #16a34a;

  font-size: 14px;
  font-weight: 700;
}

/* ==============================
   フッター
============================== */

.site-footer {
  padding: 24px 16px 36px;

  text-align: center;

  color: #777;

  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;

  gap: 16px;

  margin-bottom: 12px;
}

.footer-links a {
  color: #666;

  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ==============================
   説明コンテンツ
============================== */

.tool-guide,
.tool-about,
.tool-uses,
.tool-faq {
  width: 100%;
  max-width: 720px;

  margin: 36px auto 0;

  padding: 28px 32px;

  background: #ffffff;

  border-radius: 16px;

  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.tool-guide h2,
.tool-about h2,
.tool-uses h2,
.tool-faq h2 {
  margin: 0 0 18px;

  font-size: 22px;
}

.tool-guide p,
.tool-about p,
.tool-uses p,
.tool-faq p,
.tool-guide li,
.tool-uses li {
  color: #555;

  font-size: 15px;
  line-height: 1.9;
}

.tool-guide ol,
.tool-uses ul {
  margin: 0;

  padding-left: 22px;
}

.tool-about p {
  margin: 0 0 14px;
}

.tool-about p:last-child {
  margin-bottom: 0;
}

.faq-item {
  padding: 18px 0;

  border-bottom: 1px solid #e5e7eb;
}

.faq-item:first-of-type {
  padding-top: 0;
}

.faq-item:last-child {
  padding-bottom: 0;

  border-bottom: none;
}

.faq-item h3 {
  margin: 0 0 8px;

  font-size: 16px;
}

.faq-item p {
  margin: 0;
}

@media (max-width: 600px) {
  .tool-guide,
  .tool-about,
  .tool-uses,
  .tool-faq {
    margin-top: 24px;

    padding: 24px 18px;

    border-radius: 12px;
  }

  .tool-guide h2,
  .tool-about h2,
  .tool-uses h2,
  .tool-faq h2 {
    font-size: 20px;
  }
}

/* ==============================
   スマホ
============================== */

@media (max-width: 600px) {
  .main-content {
    padding: 24px 12px 40px;
  }

  .tool-card {
    padding: 24px 18px;

    border-radius: 12px;
  }

  .tool-heading h1 {
    font-size: 23px;
  }

  textarea {
    min-height: 210px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .reset-button {
    grid-column: auto;
  }

  .result-item {
    padding: 9px 12px;
  }

  .rank-number {
    width: 38px;
    height: 38px;

    margin-right: 12px;
  }

  .member-name {
    font-size: 16px;
  }

  .footer-links {
    flex-direction: column;

    gap: 8px;
  }
}
