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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
  padding-bottom: 80px;
}

header {
  background: #4a90d9;
  color: white;
  padding: 20px 16px 16px;
  text-align: center;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background: #fafbfc;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: #4a90d9;
  background: white;
}

.date-input-row,
.paste-row {
  display: flex;
  gap: 8px;
}

.date-input-row input,
.paste-row input {
  flex: 1;
}

.btn-add {
  padding: 10px 16px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-add:hover {
  background: #357abd;
}

.date-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f0f4f9;
  border-radius: 8px;
  font-size: 0.95rem;
}

.date-list li button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.date-list li button:hover {
  color: #e55;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  background: white;
  color: #4a90d9;
  border: 2px solid #4a90d9;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f0f6ff;
}

.url-box {
  background: #f0f4f9;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  word-break: break-all;
  color: #555;
  margin-bottom: 8px;
  min-height: 48px;
  font-family: monospace;
  line-height: 1.5;
}

.btn-copy {
  display: block;
  width: 100%;
  padding: 10px;
  background: #34c759;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: #28a745;
}

.hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 6px;
  text-align: center;
}

/* 回答ボタン（○×△） */
.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.vote-row:last-child {
  border-bottom: none;
}

.vote-date-label {
  font-size: 0.95rem;
  flex: 1;
}

.vote-btns {
  display: flex;
  gap: 8px;
}

.vote-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #dde3ec;
  background: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-btn:hover {
  border-color: #4a90d9;
}

.vote-btn.selected-maru {
  background: #e6f4ea;
  border-color: #34c759;
  color: #28a745;
}

.vote-btn.selected-batsu {
  background: #fdecea;
  border-color: #e55;
  color: #e55;
}

.vote-btn.selected-sankaku {
  background: #fff8e1;
  border-color: #f0a500;
  color: #e69500;
}

/* 集計テーブル */
.result-table-wrapper {
  overflow-x: auto;
}

table.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.result-table th,
table.result-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

table.result-table th {
  background: #f5f7fa;
  font-weight: 600;
  color: #666;
  font-size: 0.78rem;
}

table.result-table td.name-col {
  text-align: left;
  font-weight: 500;
}

table.result-table tfoot td {
  font-weight: 700;
  background: #f0f4f9;
  font-size: 0.85rem;
}

.maru { color: #28a745; }
.batsu { color: #e55; }
.sankaku { color: #e69500; }

.best-date {
  background: #e6f4ea !important;
  font-weight: 700;
}

/* ナビゲーション */
.main-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-btn.active {
  color: #4a90d9;
  border-top: 2px solid #4a90d9;
}

.nav-bottom {
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.error-msg {
  color: #e55;
  font-size: 0.83rem;
  margin-top: 6px;
}

@media (min-width: 600px) {
  header h1 {
    font-size: 1.6rem;
  }

  main {
    padding: 24px 16px;
  }
}
