/* ============================================
  🌙 さんかがたたんか 〜みそひともじ〜 共通CSS
============================================ */

/* --------------------------------------------
  全体共通
-------------------------------------------- */

body {
  font-family: 'Yuji Syuku', serif;
  font-size: 16px;
  background: #f9f7f1;
  color: #333;
  line-height: 1.8;
}

@media (max-width: 600px) {
  body {
    font-size: 18px;
  }
}

h1 {
  text-align: center;
}

h1 img {
  display: block;
  margin: 0 auto;
  max-width: 600px;
  height: auto;
}

@media (max-width: 600px) {
  h1 img {
    max-width: 300px;
  }
}

p {
  margin: 0.5rem 0;
}

.logo a {
  display: inline-block;
  text-decoration: none;
}

.site-intro-poem {
  text-align: center;
  font-family: 'Yuji Syuku', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 1rem 0;
  color: #7aa27c;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-description {
  font-size: 0.9rem;
  color: #555;
  margin: 1rem 0;
  line-height: 1.6;
  text-align: left;
}

.today-date {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5em;
  text-align: center;
}

/* --------------------------------------------
  あなたの今日の一文字表示
-------------------------------------------- */

#yourLetter {
  background: #fdfdf7;
  border: 2px solid #7aa27c;
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  text-align: center;
  width: 325px;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  #yourLetter {
    width: 100%;
    max-width: 600px;
    display: block;
  }
}

#yourLetter .vote-char {
  display: block;
  margin-top: 0.5em;
  font-size: 1.5em;
}

/* --------------------------------------------
  途中経過エリア
-------------------------------------------- */

#progress {
  background: #fdfdf7;
  border: 2px solid #7aa27c;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  max-width: 600px;
  margin: 1rem 0;
  font-size: 1.2rem;
  line-height: 2;
  text-align: center;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

#progress .progress-line {
  display: block;
  margin: 0.2em 0;
}

@media (min-width: 600px) {
  #progress .progress-line {
    display: inline;
    margin: 0 0.8em;
  }

  #progress .progress-line:nth-child(4)::before {
    content: "\A";
    white-space: pre;
    display: block;
    line-height: 0;
    margin: 0;
  }
}

#progress a {
  text-decoration: none;
  color: #7aa27c;
}

#progress a:hover {
  text-decoration: underline;
}

.cursor {
  color: #7aa27c;
  display: inline-block;
  margin-left: 0.2em;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --------------------------------------------
  50音表エリア
-------------------------------------------- */

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 600px;
}

.row {
  display: block;
  width: 100%;
}

.letter {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #fffef9;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 1.2rem;
  padding: 16px 10px;
  min-width: 40px;
}

.letter:hover {
  background: #f4f0e8;
  transform: translateY(-2px);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.15);
}

.letter.voted {
  background: #e6dfd1;
  border-color: #999;
  opacity: 0.8;
  cursor: default;
}

.letter.voted:hover {
  background: #e6dfd1;
  transform: none;
  box-shadow: none;
}

.letter.empty {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 600px) {
  .row {
    display: flex;
    gap: 0.3rem;
  }

  .row .letter {
    flex: 1 0 18%;
    box-sizing: border-box;
    font-size: 1.6rem;
    padding: 1.2rem 0;
  }
}

/* --------------------------------------------
  汎用ボタン
-------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #333;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #555;
}

/* --------------------------------------------
  フッター
-------------------------------------------- */

footer {
  margin-top: 3rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  border-top: 1px dashed #7aa27c;
}

footer p {
  margin: 0;
}

.footer-nav {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer-nav a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: #7aa27c;
}

.footer-nav a:hover {
  text-decoration: underline;
}

footer .thank-hidden {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.2rem;
  font-style: italic;
  opacity: 0.8;
}

/* --------------------------------------------
  モーダル & ローディング
-------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #f9f7f1;
  border: 2px solid #7aa27c;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  font-family: 'Yuji Syuku', serif;
  max-width: 300px;
}

.modal-buttons {
  margin-top: 1.5rem;
}

.modal-buttons button {
  margin: 0 0.5rem;
  padding: 0.5rem 1.5rem;
  font-family: inherit;
  border: none;
  background: #7aa27c;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.modal-buttons button:hover {
  background: #5f8662;
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f9f7f1;
  border: 2px solid #7aa27c;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-family: 'Yuji Syuku', serif;
  font-size: 1.2rem;
  z-index: 1000;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

/* --------------------------------------------
  履歴ページ（history.html）
-------------------------------------------- */

#history {
  max-width: 600px;
  margin: 2rem auto;
  line-height: 1.8;
}

#history h3 {
  margin-top: 2rem;
  font-size: 1.2rem;
  color: #333;
  border-bottom: 2px solid #7aa27c;
  display: inline-block;
  padding-bottom: 0.2rem;
}

#history p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

#history a {
  text-decoration: none;
  color: #7aa27c;
}

#history a:hover {
  text-decoration: underline;
}

#history ul {
  padding-left: 1rem;
  list-style-type: disc;
}

#history li {
  margin: 0.2rem 0;
}

.back-link {
  margin-top: 2rem;
  text-align: center;
}

.back-link a {
  text-decoration: none;
  color: #7aa27c;
}

.back-link a:hover {
  text-decoration: underline;
}


.share-buttons {
  display: flex;          /* 横並びにする */
  justify-content: center; /* 中央寄せ */
  gap: 0.5rem;            /* ボタン間の隙間 */
  margin-top: 1.5rem;
}

.share-btn {
  display: inline-flex;    /* アイコンとテキストを横並びに */
  align-items: center;
  background: #7aa27c;
  color: #fff;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.share-btn svg {
  margin-right: 0.4rem;
}

.share-btn:hover {
  background: #5f8662;
}
