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

body {
  font-family: "Yu Gothic", "游ゴシック", YuGothic, "游ゴシック体", sans-serif;
  background: linear-gradient(135deg, #fff0d6, #fff8eb);
  min-height: 100vh;
  position: relative;
  overflow-x: auto;
}

body::before {
  content: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.1);
  z-index: -1;
  letter-spacing: 0.5rem;
  white-space: nowrap;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid #fffff0;
  background-color: #fffff0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  height: 30px;
  vertical-align: middle;
}

.home-link {
  margin-left: 15px;
  color: #0073aa;
  text-decoration: none;
  font-weight: none;
}

.home-link:hover {
  text-decoration: underline;
}


h2 {
  color: #d2691e; /* オレンジ系で統一 */
  text-align: left;
  font-size: 1.4rem;
  margin: 15px 5px 0px;
  position: relative;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6);
}

h3 {
  font-size: 1.2rem;
  font-weight: bold;
  color: #666; /* 少し濃いオレンジ系で統一感 */
  margin: 5px 7px 8px;
  letter-spacing: 0.02em;
}


.explanation {
  margin-top: 0px;
  border-top: 1px solid #ccc;
  padding-top: 0px;
}

.explanation h2 {
  margin-top: 10px;
  margin-bottom: 0px;
}

.explanation p {
  line-height: 1.8;
  margin-bottom: 0px; /* ← ここで下の余白を確保 */
  color: #444;
}




.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

h1 {
  text-align: center;
  color: #b85c00;
  margin-bottom: 20px;
  font-size: 2.0rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-description {
    text-align: left;
    font-size: 15px;
    color: #444;
    margin-bottom: 20px;
}

.controls {
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-section {
  margin-bottom: 15px;
}

.control-section h3 {
  color: #d2691e;
  margin-bottom: 8px;
  font-size: 0.7rem;
}

.search-instruction {
  font-weight: normal;
  font-size: 0.9rem;
  color: #666;
  margin-left: 10px; /* h3との間隔 */
}


.type-explanation {
  color: #666;
  font-size: 0.75rem;
  margin-bottom: 6px;
  font-style: italic;
}

.alphabet-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 15px;
}

.alphabet-btn {
  background: #4169e1;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
}

.alphabet-btn:hover {
  background: #1e90ff;
  transform: translateY(-2px);
}

.alphabet-btn.disabled {
  background: #cccccc;
  color: #666666;
  cursor: default;
  transform: none;
  position: relative;
}

.alphabet-btn.disabled:hover {
  background: #cccccc;
  transform: none;
}

.alphabet-btn.disabled:hover::after {
  content: "該当する動詞がありません";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
}

.alphabet-btn.disabled:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

.alphabet-btn.selected {
  background: #d3d3d3;
  color: #666;
}

.search-section {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-size: 1rem;
  flex: 1;
  min-width: 200px;
}

.search-btn {
  background: #32cd32;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: #228b22;
  transform: translateY(-2px);
}

.type-buttons,
.level-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.type-btn {
  background: #9370db;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
}

.type-btn:hover {
  background: #8a2be2;
  transform: translateY(-2px);
}

.type-btn.selected {
  background: #d3d3d3;
  color: #666;
}

.level-btn {
  background: #ff6347;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
}

.level-btn:hover {
  background: #ff4500;
  transform: translateY(-2px);
}

.level-btn.selected {
  background: #d3d3d3;
  color: #666;
}

.category-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-btn {
  background: #20b2aa;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.category-btn:hover {
  background: #008b8b;
  transform: translateY(-2px);
}

.category-btn.selected {
  background: #d3d3d3;
  color: #666;
}

.all-btn {
  background: #808080 !important;
}

.all-btn:hover {
  background: #696969 !important;
}

.all-btn.selected {
  background: #d3d3d3 !important;
  color: #666 !important;
}

.reset-btn {
  background: #dc143c;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.reset-btn:hover {
  background: #b22222;
  transform: translateY(-2px);
}

/* 選択された条件の表示エリア */
.selected-conditions {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #ff8c00;
  border-radius: 12px;
  padding: 10px;
  margin: 12px 0;
}

.selected-conditions h3 {
  color: #d2691e;
  margin-bottom: 10px;
  font-size: 0.9rem;
  text-align: center;
}

.selected-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-category {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.category-label {
  font-weight: bold;
  color: #666;
  min-width: 90px;
  font-size: 0.85rem;
}

.selected-alphabet,
.selected-types,
.selected-levels,
.selected-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.selected-item {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.selected-item:hover {
  transform: translateY(-1px);
  opacity: 0.8;
}

.selected-item:hover::after {
  content: "×";
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ff4444;
  color: white;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

/* 選択されたアイテムの色分け */
.selected-alphabet .selected-item {
  background: #4169e1;
  color: white;
}

.selected-types .selected-item {
  background: #9370db;
  color: white;
}

.selected-levels .selected-item {
  background: #ff6347;
  color: white;
}

.selected-categories .selected-item {
  background: #20b2aa;
  color: white;
}

.verb-table {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#verbList {
  scroll-margin-top: 120px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #ff8c00;
  color: white;
  padding: 12px 8px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
}

td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 1rem;
  vertical-align: middle;
}

tr:nth-child(even) {
  background: rgba(255, 165, 0, 0.1);
}

tr:hover {
  background: rgba(255, 140, 0, 0.2);
}

/* テーブルの動詞表示部分を更新 */
.verb-base,
.verb-past,
.verb-pp {
  text-align: center;
  vertical-align: middle;
}

.verb-word {
  font-weight: bold;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 2px;
}

.verb-base .verb-word {
  color: #d2691e;
}

.verb-past .verb-word {
  color: #4169e1;
}

.verb-pp .verb-word {
  color: #9370db;
}

.verb-reading {
  color: #666;
  font-size: 0.75rem;
  font-weight: normal;
  font-style: italic;
  display: block;
}

.verb-meaning {
  color: #2e8b57;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  vertical-align: middle;
}

.verb-type {
  background: #ffa500;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: bold;
}

.verb-level {
  background: #ff6347;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: bold;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 1.2rem;
}

.search-execute-section {
  text-align: center;
  margin: 20px 0;
}

.execute-search-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Meiryo", "メイリオ", sans-serif;
  font-weight: bold;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.execute-search-btn:hover {
  background: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.execute-search-btn:active {
  transform: translateY(0);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  body::before {
    font-size: 4rem;
    letter-spacing: 0.2rem;
  }

  .search-section {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .alphabet-buttons {
    gap: 3px;
  }

  .alphabet-btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .type-buttons,
  .level-buttons {
    gap: 5px;
  }

  .type-btn,
  .level-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .type-explanation {
    font-size: 0.8rem;
  }

  .selected-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .category-label {
    min-width: auto;
  }

  /* スマホ用カードレイアウト */
  .verb-table table {
    display: none;
  }

  .verb-cards {
    display: block;
  }

  .verb-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ff8c00;
  }

  .verb-card-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .verb-card-base {
    text-align: center;
  }

  .verb-card-base .verb-form-label {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 2px;
    font-weight: normal;
  }

  .verb-card-base .verb-form-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #d2691e;
  }

  .verb-card-past {
    text-align: center;
  }

  .verb-card-past .verb-form-label {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 2px;
    font-weight: normal;
  }

  .verb-card-past .verb-form-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4169e1;
  }

  .verb-card-pp {
    text-align: center;
  }

  .verb-card-pp .verb-form-label {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 2px;
    font-weight: normal;
  }

  .verb-card-pp .verb-form-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #9370db;
  }

  .verb-card-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
  }

  .verb-card-meaning {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    color: #2e8b57;
    font-size: 1rem;
    margin: 0;
  }

  .verb-card-reading {
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* スマホ用カードの読み仮名スタイル */
  .verb-form-reading {
    font-size: 0.65rem;
    color: #666;
    font-weight: normal;
    font-style: italic;
    margin-top: 2px;
  }







  .category-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .execute-search-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  body::before {
    font-size: 2rem;
    letter-spacing: 0.1rem;
  }

  .controls {
    padding: 15px;
  }

  .control-section h3 {
    font-size: 1rem;
  }

  .alphabet-btn {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  .type-btn,
  .level-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .reset-btn {
    padding: 10px 20px;
    font-size: 1rem;
  }

  .type-explanation {
    font-size: 0.7rem;
  }

  .verb-card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .verb-card-base {
    font-size: 1.2rem;
  }

  .verb-card-reading {
    font-size: 0.8rem;
  }

  .verb-card-forms {
    gap: 10px;
  }

  .verb-form-value {
    font-size: 1rem;
  }

  .verb-card-meaning {
    font-size: 0.9rem;
  }

  .category-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .execute-search-btn {
    padding: 10px 20px;
    font-size: 1rem;
  }
}

/* デスクトップ用テーブル表示 */
@media (min-width: 769px) {
  .verb-cards {
    display: none;
  }
}

/* 印刷用スタイル */
@media print {
  body {
    background: white;
    color: black;
  }

  body::before {
    display: none;
  }

  .controls {
    display: none;
  }

  .verb-table {
    box-shadow: none;
    border: 1px solid #000;
  }

  th {
    background: #f0f0f0 !important;
    color: black !important;
    border: 1px solid #000;
  }

  td {
    border: 1px solid #000;
  }

  tr:hover {
    background: transparent !important;
  }

  .verb-base,
  .verb-past,
  .verb-pp,
  .verb-meaning,
  .verb-reading {
    color: black !important;
  }

  .verb-type,
  .verb-level {
    background: #f0f0f0 !important;
    color: black !important;
    border: 1px solid #000;
  }

  .verb-base,
  .verb-past,
  .verb-pp {
    font-size: 1.2rem !important;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.verb-table {
  animation: fadeIn 0.5s ease-out;
}

/* フォーカススタイル */
.search-input:focus {
  outline: none;
  border-color: #ff8c00;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
}

.alphabet-btn:focus,
.search-btn:focus,
.type-btn:focus,
.level-btn:focus,
.reset-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* スクロールバーのスタイル */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.7);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 140, 0, 0.9);
}



/* Footer */
.footer {
  background: #333;
  color: white;
  padding: 40px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.footer-logo img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.footer-nav {
  display: flex;
  gap: 30px;
}

.footer-nav a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #ff6b35;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #555;
  color: #ccc;
}

#chatTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 55px;
  height: 55px;
  background-color: #58d68d;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

#chatTopBtn:hover {
  background-color: #45b97c;
  transform: scale(1.05);
}

/* スクロールするまで非表示にする場合 */
#chatTopBtn.hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#chatTopBtn.show {
  opacity: 1;
}


.search-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
}

.search-japanese, .search-conditions {
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-japanese h2, .search-conditions h2 {
  font-size: 1.4rem;
  color: #d2691e;
  margin-bottom: 12px;
  text-align: left;
}

.search-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input, .search-btn {
  font-size: 1rem;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.search-btn {
  background: #32cd32;
  color: #fff;
  border: none;
  cursor: pointer;
}

.search-btn:hover {
  background: #228b22;
}

.search-note {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
}



