/* リセット・基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* メインタイトル */
h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 600;
}

/* 設定セクション */
section {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 選択項目のスタイル */
.select {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.select:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.select dt {
  font-weight: 600;
  color: #2c3e50;
  min-width: 80px;
  margin-right: 20px;
}

.select dd {
  display: flex;
  gap: 15px;
}

/* ラジオボタンとラベルのスタイル */
.select div {
  position: relative;
}

input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="radio"]:checked {
  border-color: #3498db;
  background-color: #3498db;
}

input[type="radio"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
}

label {
  cursor: pointer;
  color: #555;
  font-weight: 500;
  transition: color 0.2s ease;
}

input[type="radio"]:checked + label {
  color: #3498db;
}

/* ボタンスタイル */
.buttons {
  text-align: center;
  margin-bottom: 30px;
}

button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

button:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

button:active {
  transform: translateY(0);
}

/* パスワード表示エリア */
#generate {
  max-width: 1000px;
  margin: 0 auto;
}

#box {
  background-color: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  min-height: 100px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 生成されたパスワードのスタイル */
#box p {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  word-break: break-all;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#box p::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#box p:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#box p:hover::before {
  left: 100%;
}

/* 空の状態 */
#box:empty::before {
  content: 'パスワードを生成するには上の「生成」ボタンをクリックしてください';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-style: italic;
  height: 100px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  section {
    padding: 20px 15px;
  }
  
  .select {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .select dt {
    min-width: auto;
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  #box {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 15px;
  }
  
  #box p {
    font-size: 14px;
    padding: 12px 15px;
  }
}