
/* === ヘッダー右上 ログインボタン（未ログイン時のみ） === */
/* モバイル: ゴールド塗りでテーマトグル(暗地)とコントラスト */
.site-login-btn {
  position: absolute;
  top: 12px;
  right: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.5px solid #b88500;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd966 0%, #f5b800 55%, #d99a00 100%);
  color: #1a1408;
  text-decoration: none;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 194, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 12px rgba(245, 184, 0, 0.45),
    2px 2px 0 rgba(0, 0, 0, 0.35);
  z-index: 100;
  transition: background 0.18s ease, color 0.18s ease,
              transform 0.12s ease, box-shadow 0.18s ease;
}
.site-login-btn:hover {
  background: linear-gradient(180deg, #fff0a8 0%, #ffd966 55%, #f5b800 100%);
  transform: scale(1.1) translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 194, 0.7),
    0 0 18px rgba(245, 184, 0, 0.7),
    3px 3px 0 rgba(0, 0, 0, 0.4);
}
.site-login-btn:active {
  transform: scale(0.95);
}
.site-login-btn-icon {
  width: 14px;
  height: 26px;
  flex-shrink: 0;
  image-rendering: pixelated;
  fill: currentColor;
}
/* スマホではラベル非表示、アイコンのみ */
.site-login-btn-label {
  display: none;
  font-family: inherit;
}

/* デスクトップ以上ではテキスト付きの横長ボタン */
@media (min-width: 768px) {
  .site-login-btn {
    width: auto;
    height: auto;
    padding: 7px 14px 7px 11px;
    border-radius: 4px;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    right: 56px;
    text-shadow: 0 1px 0 rgba(255, 245, 194, 0.4);
  }
  .site-login-btn-label { display: inline; }
}

/* === ヘッダー右上テーマトグルボタン === */
.site-theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 30%, rgba(245, 184, 0, 0.25), rgba(245, 184, 0, 0.08) 60%, transparent 100%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  overflow: hidden;
  transition: background 0.25s ease, transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 10px rgba(245, 184, 0, 0.25);
}
:root[data-theme="light"] .site-theme-toggle {
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 220, 130, 0.6), rgba(255, 220, 130, 0.18) 65%, transparent 100%);
  border-color: #f5b800;
  box-shadow: 0 0 14px rgba(245, 184, 0, 0.45);
}
.site-theme-toggle:hover {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 0 18px rgba(245, 184, 0, 0.55);
}
.site-theme-toggle:active {
  transform: scale(0.96);
}
.site-theme-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
}
.site-theme-toggle .theme-icon-light { display: none; }
.site-theme-toggle .theme-icon-dark  { display: block; }
:root[data-theme="light"] .site-theme-toggle .theme-icon-light { display: block; }
:root[data-theme="light"] .site-theme-toggle .theme-icon-dark  { display: none; }

/* 太陽の光線をゆっくり回転 */
.site-theme-toggle .ttl-rays {
  transform-origin: 24px 24px;
  animation: ttl-rays-spin 18s linear infinite;
}
@keyframes ttl-rays-spin {
  to { transform: rotate(360deg); }
}
/* 太陽本体は微かに鼓動 */
.site-theme-toggle .ttl-sun {
  transform-origin: 24px 24px;
  animation: ttl-sun-pulse 3s ease-in-out infinite;
}
@keyframes ttl-sun-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
/* 星が瞬く */
.site-theme-toggle .ttl-stars circle {
  animation: ttl-twinkle 2.5s ease-in-out infinite;
}
.site-theme-toggle .ttl-stars circle:nth-child(2) { animation-delay: 0.4s; }
.site-theme-toggle .ttl-stars circle:nth-child(3) { animation-delay: 0.9s; }
.site-theme-toggle .ttl-stars circle:nth-child(4) { animation-delay: 1.3s; }
@media (prefers-reduced-motion: reduce) {
  .site-theme-toggle .ttl-rays,
  .site-theme-toggle .ttl-sun,
  .site-theme-toggle .ttl-stars circle { animation: none; }
}

/* === タイトル「！」のすぐ後ろに置く家＋木のシーン === */
.title-scene {
  display: inline-block;
  vertical-align: -0.55em;
  width: 76px;
  height: 38px;
  margin-left: 6px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.title-scene svg { width: 100%; height: 100%; display: block; }
.title-scene .title-scene-light { display: none; }
.title-scene .title-scene-dark  { display: block; }
:root[data-theme="light"] .title-scene .title-scene-light { display: block; }
:root[data-theme="light"] .title-scene .title-scene-dark  { display: none; }

/* スマホ最狭で家が大きく見えすぎないよう */
@media (max-width: 380px) {
  .title-scene {
    width: 60px;
    height: 30px;
    margin-left: 3px;
    vertical-align: -0.45em;
  }
}

/* シーン内アニメ: 星瞬き／煙ふわり／鳥はばたき */
.title-scene .scene-stars circle {
  animation: ts-twinkle 3s ease-in-out infinite;
}
.title-scene .scene-stars circle:nth-child(2) { animation-delay: 0.6s; }
.title-scene .scene-stars circle:nth-child(3) { animation-delay: 1.2s; }
.title-scene .scene-stars circle:nth-child(4) { animation-delay: 1.8s; }
@keyframes ts-twinkle {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}
.title-scene .scene-smoke {
  animation: ts-smoke 4s ease-in-out infinite;
}
@keyframes ts-smoke {
  0%   { opacity: 0.3; transform: translateY(0); }
  50%  { opacity: 0.7; transform: translateY(-1.5px); }
  100% { opacity: 0.3; transform: translateY(0); }
}
.title-scene .scene-bird {
  transform-origin: 56px 7px;
  animation: ts-bird 2.2s ease-in-out infinite;
}
@keyframes ts-bird {
  0%, 100% { transform: translateX(0) translateY(0); }
  25%      { transform: translateX(2px) translateY(-1px); }
  50%      { transform: translateX(4px) translateY(0); }
  75%      { transform: translateX(2px) translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .title-scene .scene-stars circle,
  .title-scene .scene-smoke,
  .title-scene .scene-bird { animation: none; }
}
.theme-house-scene svg { width: 100%; height: 100%; display: block; }
.theme-house-scene .theme-house-light { display: none; }
.theme-house-scene .theme-house-dark  { display: block; }
:root[data-theme="light"] .theme-house-scene .theme-house-light { display: block; }
:root[data-theme="light"] .theme-house-scene .theme-house-dark  { display: none; }

/* 星の瞬き（家シーン用） */
.theme-house-scene .house-stars circle {
  animation: house-twinkle 3s ease-in-out infinite;
}
.theme-house-scene .house-stars circle:nth-child(2) { animation-delay: 0.6s; }
.theme-house-scene .house-stars circle:nth-child(3) { animation-delay: 1.2s; }
.theme-house-scene .house-stars circle:nth-child(4) { animation-delay: 1.8s; }
@keyframes house-twinkle {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}
/* 煙突の煙がふわりと上昇 */
.theme-house-scene .house-smoke {
  animation: house-smoke-rise 4s ease-in-out infinite;
  transform-origin: 33.5px 14px;
}
@keyframes house-smoke-rise {
  0%   { opacity: 0.4; transform: translateY(0) scaleY(1); }
  50%  { opacity: 0.7; transform: translateY(-2px) scaleY(1.05); }
  100% { opacity: 0.4; transform: translateY(0) scaleY(1); }
}
/* 日差し線が呼吸 */
.theme-house-scene .house-sun-rays {
  animation: house-rays-breathe 3.5s ease-in-out infinite;
  transform-origin: 24px 24px;
}
@keyframes house-rays-breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-house-scene .house-stars circle,
  .theme-house-scene .house-smoke,
  .theme-house-scene .house-sun-rays { animation: none; }
}

/* スマホで横幅狭いときは少し小さく */
@media (max-width: 380px) {
  .theme-house-scene {
    width: 44px;
    height: 44px;
    right: 4px;
  }
}

/* === フォーム要素のダーク統一 === */
input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  background-color: var(--bg-card-hi);
  color: var(--text-main);
  border-color: rgba(245,184,0,0.22);
}

input:not([type="submit"]):not([type="button"]):not([type="reset"])::placeholder,
textarea::placeholder {
  color: var(--text-light);
}

