* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f0f4f8;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ヘッダーナビ */
.site-header {
  background: #fff;
  border-bottom: 2px solid #f0f0f0;
  padding: 14px 20px;
  text-align: center;
}
.site-header a {
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  color: #f552a0;
  letter-spacing: -0.5px;
}

/* コンテナ */
.container {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

/* ページタイトル */
.page-header {
  text-align: center;
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 24px;
  color: #f552a0;
  font-weight: 900;
}
.page-header p {
  color: #888;
  font-size: 14px;
  margin-top: 6px;
}

/* カード */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}
.card h2 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #222;
  border-left: 4px solid #f552a0;
  padding-left: 12px;
}

/* フォーム */
label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #555;
  margin-bottom: 6px;
}
input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
  font-family: inherit;
  background: #fff;
}
input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  border-color: #f552a0;
}
textarea { resize: vertical; min-height: 80px; }

/* 日程候補 */
.date-list { margin-bottom: 12px; }
.date-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.date-item input { margin-bottom: 0; flex: 1; }
.remove-btn {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.add-date-btn {
  background: #fff0f7;
  color: #f552a0;
  border: 2px dashed #f552a0;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

/* ボタン */
.btn-primary {
  background: #f552a0;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}
.btn-primary:hover { background: #d93d87; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

/* URLシェアボックス */
.share-box {
  background: #fff0f7;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.share-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: #f552a0;
  font-size: 13px;
  margin-bottom: 0;
  outline: none;
}
.copy-btn {
  background: #f552a0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.copy-btn:hover { background: #d93d87; }

/* 名前入力行 */
.name-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.name-input-row label { margin-bottom: 0; white-space: nowrap; }
.name-input-row input { flex: 1; margin-bottom: 0; }

/* 回答テーブル */
.vote-table-wrap { overflow-x: auto; }
.vote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 360px;
}
.vote-table th {
  background: #fff0f7;
  padding: 12px 10px;
  text-align: center;
  border-bottom: 2px solid #f0f0f0;
  color: #555;
  font-weight: bold;
}
.vote-table th:first-child { text-align: left; }
.vote-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #f5f5f5;
}
.vote-table td:first-child { text-align: left; font-weight: bold; }

/* 回答バッジ（結果表示） */
.badge {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  align-items: center;
  justify-content: center;
}
.badge-maru    { background: #dcfce7; color: #16a34a; }
.badge-sankaku { background: #fef9c3; color: #ca8a04; }
.badge-batu    { background: #fee2e2; color: #dc2626; }

/* 投票ボタン */
.vote-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vote-btn.sel-maru    { background: #dcfce7; border-color: #16a34a; }
.vote-btn.sel-sankaku { background: #fef9c3; border-color: #ca8a04; }
.vote-btn.sel-batu    { background: #fee2e2; border-color: #dc2626; }

/* 集計バー */
.result-bar-wrap { margin-bottom: 18px; }
.result-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
  color: #444;
  flex-wrap: wrap;
  gap: 4px;
}
.result-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.result-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: #f552a0;
  transition: width 0.5s;
}
.result-bar-fill.best { background: #16a34a; }

.best-badge {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.count-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.count-maru    { color: #16a34a; font-weight: bold; }
.count-sankaku { color: #ca8a04; font-weight: bold; }
.count-batu    { color: #dc2626; font-weight: bold; }

/* メッセージ */
.msg-error {
  background: #fee2e2;
  color: #dc2626;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.msg-success {
  background: #dcfce7;
  color: #16a34a;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* フッター */
.site-footer {
  background: #888;
  border-top: 1px solid #777;
  padding: 14px 20px;
  text-align: center;
}
.footer-inner {
  max-width: 340px;
  margin: 0 auto;
}
.site-footer img {
  height: 18px;
  opacity: 0.85;
}
.site-footer p {
  font-size: 10px;
  color: #eee;
  margin-top: 4px;
}

/* ローディング */
.loading {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 14px;
}
