body {
  font-family: sans-serif;
  margin: 20px;
  background: #f4f6f8;
  /* background: #fff3c4; */
}

input,
button {
  padding: 8px;
  margin-right: 8px;
  font-size: 14px;
}

#country-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 0;
  margin-top: 20px;
}

#country-list li {
  list-style: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: #fff;
  padding-right: 40px;
  position: relative;
}


#country-list img {
  width: 40px;
}

.info {
  display: flex;
  flex-direction: column;
}

strong {
  font-size: 1rem;
  padding-right: 24px;
  display: block;
}

.info span {
  font-size: 0.85rem;
  color: #555;
}

/* モーダル */
#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
}

#modal.show {
  display: flex;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 300px;
  max-width: 90%;
  text-align: center;
}

.modal-content img {
  width: 100px;
  margin: 10px 0;
}

#close {
  float: right;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.3rem;
}

.fav-btn:hover {
  transform: scale(1.2);
}

.top-bar {
  position: sticky;
  top: 0;
  /* background: linear-gradient(135deg,#f8fbff,#eef3ff); */
  background: linear-gradient(135deg, #f9fbff, #f1f5ff);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.fav-toggle {
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  /* background: #f3f3f3; */
  transition: background 0.2s;
  background: #f1f4f8;
}

.fav-toggle input {
  transform: scale(1.3);
  /* display: none; */
}

.fav-toggle input:checked + span {
  font-weight: bold;
}

.fav-toggle:has(input:checked) {
  background: #ffe08a;
  font-weight: bold;
}

.fav-count {
  background: #ff6b6b;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 50%;
  margin-left: 6px;
  font-weight: bold;
}

body.favorite-mode {
  background: #fffdf2;
}

.empty {
  list-style: none;
  text-align: center;
  color: #777;
  padding: 40px 0;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty p {
  font-size: 1.1rem;
  margin-bottom: 6px;
  font-weight: bold;
  text-align: center;
}

.empty small {
  font-size: 13px;
  color: #888;
}


/* #country-list li.empty {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
} 左寄せにしたい時*/

.title-area {
  display: flex;
  flex-direction: column;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
  margin: 0;
}

.site-title .icon {
  font-size: 1.6rem;
  transition: transform 0.2s;
}

.site-title:hover .icon {
  transform: rotate(-10deg) scale(1.1);
}

.subtitle {
  /* margin-top: -10px; */
  font-size: 0.9rem;
  color: #666;
  /* margin-bottom: 20px; */
  text-align: center;
  margin: 4px 0 0;
}

.reset-btn {
  padding: 6px 12px;
  margin-left: 8px;
  font-size: 14px;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.reset-btn:hover {
  background: #eaeaea;
  color: #222;
}

.reset-btn:active {
  transform: translateY(1px);
}

.reset-btn::before {
  content: "↺";
  margin-right: 4px;
}


