/* ホバーエフェクト ギャラリー 共通スタイル */
/* ページUIのスタイルのみを置く。エフェクト本体のCSSは js/effects/ の定義から動的に注入する */

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

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 16px;
  line-height: 1.7;
}

/* ============ ヘッダー ============ */
.header {
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #3730a3 100%);
  color: #fff;
  padding: 40px 20px 36px;
  text-align: center;
}
.header h1 {
  font-size: clamp(1.4rem, 1.1rem + 1.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.header p {
  margin-top: 10px;
  color: #c7d2fe;
  font-size: 1rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
/* 言語切替リンク（ja ↔ en。ヘッダー右上） */
.lang-switch {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(147, 197, 253, 0.5);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 1rem;
  text-decoration: none;
}
.lang-switch:hover {
  background: rgba(147, 197, 253, 0.15);
}

/* ============ レイアウト ============ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 2px;
}

/* ============ サイドバー カード ============ */
.input-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
}
.input-card h2 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.code-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  line-height: 1.55;
  max-height: 320px;
  overflow: auto;
  white-space: pre;
}
.code-box code:empty::before {
  content: "カードをクリックするとコードが表示されます";
  color: #64748b;
  white-space: normal;
}
html[lang="en"] .code-box code:empty::before {
  content: "Click a card to see its code";
}
.copy-preview {
  margin-top: 12px;
  width: 100%;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.copy-preview:hover {
  background: #4f46e5;
}
.copy-preview:disabled {
  background: #cbd5e1;
  cursor: default;
}

/* 色設定 */
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-size: 1rem;
  color: #475569;
  margin-bottom: 4px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-row input[type="color"] {
  width: 46px;
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.color-row .color-val {
  font-family: Consolas, Menlo, monospace;
  font-size: 1rem;
  color: #475569;
}
.reset-settings {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 1rem;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.reset-settings:hover {
  border-color: #94a3b8;
  color: #1e293b;
}
.count-note {
  margin-top: 10px;
  font-size: 1rem;
  color: #64748b;
  text-align: center;
}

/* ============ フィルタ ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover {
  border-color: #6366f1;
  color: #6366f1;
}
.chip.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* ============ グリッド ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card.selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.stage {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  cursor: pointer;
  padding: 16px;
  overflow: hidden;
}
.stage.dark {
  background: #0f172a;
}
.card-info {
  padding: 10px 14px 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-cat {
  font-size: 12px;
  color: #6366f1;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.card-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  min-width: 0;
}
.copy-btn {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.copy-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}
.copy-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

/* ============ トースト ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ howto（使い方・FAQページ） ============ */
.howto-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.howto-body h2 {
  font-size: 1.4rem;
  margin: 32px 0 12px;
}
.howto-body p,
.howto-body li {
  color: #334155;
}
.howto-body ol,
.howto-body ul {
  padding-left: 24px;
  margin: 8px 0;
}
.howto-body .faq dt {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 18px;
}
.howto-body .faq dd {
  margin: 6px 0 0;
  color: #475569;
}
.back-link {
  display: inline-block;
  margin-top: 24px;
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}

/* ============ フッター（左寄せ＝右下広告との被り回避） ============ */
footer {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  padding: 24px 40px;
  color: #64748b;
  font-size: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
footer a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s;
}
footer a:hover {
  color: #1e3a8a;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
}
.footer-links a:hover {
  border-color: #1e3a8a;
  color: #1e3a8a;
}

/* ============ 広告（右下フローティングカード320×100・薄型透明枠＋×閉じ） ============ */
.footer-ad {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  width: 320px;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}
.footer-ad.is-closed {
  display: none;
}
.ad-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
  z-index: 1;
}
.ad-widget__label {
  color: #64748b;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}
.ad-widget__close {
  appearance: none;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.ad-widget__close:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.footer-ad ins.adsbygoogle {
  display: block;
  width: 320px;
  height: 100px;
}

/* ============ レスポンシブ ============ */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
}
@media screen and (max-width: 768px) {
  footer {
    flex-direction: column;
    gap: 16px;
    padding: 24px 16px;
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-ad {
    position: static;
    align-self: center;
    margin: 24px auto 0;
    gap: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
  }
  .footer-ad.is-closed {
    display: flex;
  }
  .ad-widget__head {
    display: none;
  }
  .footer-ad ins.adsbygoogle {
    width: 320px;
    height: 100px;
  }
}
@media (max-width: 600px) {
  .header {
    padding: 28px 16px;
  }
  .container {
    padding: 20px 14px 48px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
