:root {
    --primary-color: #ffeb3b; /* バナナイエロー */
    --secondary-color: #ff9800; /* オレンジ */
    --bg-color: #fff9c4;
    --text-color: #5d4037;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 1.8rem;
    text-shadow: 2px 2px 0px #fff;
    color: #e65100;
    margin-bottom: 20px;
    text-align: center;
}

/* 入力エリアのコンテナ */
.search-container {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 0 var(--secondary-color);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    margin-bottom: 30px;
    padding-bottom: 15px; /* ボタンの下にスペースを追加 */
}

.input-group {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
}

.input-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px; /* 幅を少し広げて安定させる */
}

.input-box label {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

input {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    font-family: inherit;
    color: var(--secondary-color);
    outline: none;
}

input:focus {
    border-color: var(--secondary-color);
}

button {
    width: 100%;
    padding: 12px;
    font-size: 1.2rem;
    font-weight: 900;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 4px 0 #bf360c;
}

button:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* 結果リストのスタイル */
#results {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 400px;
}

/* リストアイテム1つ分のカード */
.result-item {
    background: white;
    margin-bottom: 12px;
    padding: 12px 20px;
    border-radius: 15px;
    display: flex;
    align-items: center; /* 縦方向中央 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 左側の文字数バッジ */
.char-count {
    background: var(--primary-color);
    color: #827717;
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 900;
    margin-right: 20px;
}

.char-count span {
    font-size: 1.2rem;
    line-height: 1;
}

/* 右側の言葉情報（縦並び） */
.word-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yomi {
    font-size: 0.85rem;
    color: #9e9e9e;
}

.word {
    font-size: 1.3rem;
    color: var(--text-color);
    letter-spacing: 0.05em;
}

.error-msg {
  color: #ff5252;
  font-size: 0.75rem;
  font-weight: 900;
  margin-top: 4px;
  /* display: none を使わずに高さを確保する */
  height: 1.2rem; 
  line-height: 1.2rem;
  overflow: hidden;
}

#search-error {
    color: #ff5252;
    font-size: 0.9rem;
    font-weight: 900;
    text-align: center;
    margin-top: 15px;
    min-height: 1.2rem; /* メッセージがない時も高さを確保してガタつきを防止 */
}

footer {
  margin-top: auto; /* 画面下部に押し出す */
  padding: 40px 20px 20px;
  text-align: center;
  width: 100%;
}

.author-link {
  display: inline-block;
  background: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  border: 2px solid var(--secondary-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 900;
  transition: transform 0.2s;
  box-shadow: 0 4px 0 var(--secondary-color);
}

.author-link:hover {
  transform: scale(1.05);
}

.author-link span {
  font-size: 1.1rem;
  margin-right: 5px;
}