/* =========================================
   0. フォント読み込み
   ========================================= */
@font-face {
  font-family: "MisakiGothic";
  src: url("fonts/misaki_gothic.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "MisakiMincho";
  src: url("fonts/misaki_mincho.ttf") format("truetype");
  font-display: swap;
}

/* =========================================
   1. CSS 変数
   ========================================= */
:root {
  --gold:        #c9962a;
  --gold-light:  #e8b84b;
  --gold-pale:   #f5d98e;
  --ink:         #1a1208;
  --ink-mid:     #3d2e12;
  --ink-soft:    #5a4425;
  --parchment:   #f4e0b0;
  --parchment-d: #e8cd91;
  --white-warm:  rgba(255, 248, 230, 0.88);
  --shadow-soft: 0 4px 20px rgba(26, 18, 8, 0.14);
  --shadow-card: 0 6px 28px rgba(26, 18, 8, 0.18);
  --border:      1px solid rgba(201, 150, 42, 0.35);
  --radius:      10px;
  --radius-lg:   16px;
}

/* =========================================
   2. リセット & ベース
   ========================================= */
html { box-sizing: border-box; overflow-x: hidden; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0; padding: 0;
  overflow-x: hidden;
  background-color: var(--parchment);
  background-image: url("img/scroll_bg.png");
  background-repeat: repeat-y;
  background-position: top center;
  background-size: cover;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
}

@media (min-width: 769px) {
  body { background-attachment: fixed; }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* 見出しフォント */
h1, h2, h3, h4,
.dq-title, .logo {
  font-family: "MisakiMincho", "MisakiGothic", serif;
  letter-spacing: 0.06em;
  line-height: 1.45;
}

/* =========================================
   3. ヘッダー
   ========================================= */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 62px;
  background: rgba(244, 224, 176, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(201, 150, 42, 0.4);
  box-shadow: 0 2px 12px rgba(26, 18, 8, 0.12);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 1px 1px 0 var(--gold-pale);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0; padding: 0;
}

.nav-links li a {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.nav-links li a:hover {
  background-color: var(--gold-pale);
  color: var(--ink);
  transform: translateY(-1px);
}

.nav-links li a.nav-cta {
  background-color: var(--gold);
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(201, 150, 42, 0.5);
}

.nav-links li a.nav-cta:hover {
  background-color: var(--gold-light);
  color: var(--ink);
}

/* ハンバーガー */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  width: 26px; height: 3px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 900px) {
  header { padding: 0 16px; }
  .nav-links {
    position: absolute;
    top: 62px; right: 0;
    flex-direction: column;
    gap: 0;
    width: 210px;
    padding: 8px 0;
    background: rgba(244, 224, 176, 0.99);
    border-left: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    box-shadow: -4px 4px 16px rgba(26,18,8,0.18);
    display: none;
  }
  .nav-links.active { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li a { padding: 11px 18px; border-radius: 0; }
  .nav-links li a.nav-cta { margin: 8px 12px; border-radius: 8px; }
  .hamburger { display: flex; }
}

/* =========================================
   4. ページ共通レイアウト
   ========================================= */
.page {
  display: none;
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  min-height: 80vh;
}
.page.active { display: block; }

/* ページヘッダー */
.page-header {
  text-align: center;
  margin-bottom: 56px;
}
.page-icon {
  max-width: 540px;
  width: 100%;
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 20px rgba(26,18,8,0.2));
}
.dq-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 0 0 12px;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(255,255,255,0.6), 3px 3px 0 rgba(201,150,42,0.25);
}
.dq-subtitle {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================
   5. アニメーション
   ========================================= */
.scroll-fade {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   6. ボタン
   ========================================= */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 28px;
}

.dq-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  font-family: "MisakiMincho", "MisakiGothic", serif;
  font-size: 15px;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.65), 0 4px 14px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.06em;
}
.dq-button:hover {
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 rgba(0,0,0,0.65), 0 8px 20px rgba(0,0,0,0.22);
}
.dq-button:active {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.6);
}
.steam-button { background: #1b8fc4; color: #fff; }
.demo-button  { background: var(--gold-light); color: var(--ink); }
.btn-icon { font-size: 17px; }

/* =========================================
   7. ヒーローセクション
   ========================================= */
.hero {
  text-align: center;
  padding: 20px 0 60px;
}
.hero-img {
  max-width: 600px;
  margin: 0 auto 36px;
  filter: drop-shadow(0 12px 24px rgba(26,18,8,0.22));
}
.hero .dq-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 14px;
}

/* =========================================
   8. フィーチャーセクション（2カラム）
   ========================================= */
.feature-section {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 64px 0;
}
.feature-section.reverse { flex-direction: row-reverse; }

.section-img {
  flex: 0 0 46%;
  max-width: 46%;
  filter: drop-shadow(0 8px 18px rgba(26,18,8,0.2));
}
.feature-text {
  flex: 1;
}
.feature-text .dq-title { font-size: 1.5rem; margin-bottom: 14px; }
.feature-text p { color: var(--ink-mid); margin: 0 0 12px; }

.feature-list {
  list-style: none;
  padding: 0; margin: 16px 0 0;
}
.feature-list li {
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--ink-mid);
  border-bottom: 1px dashed rgba(201,150,42,0.3);
}
.feature-list li:last-child { border-bottom: none; }

@media (max-width: 680px) {
  .feature-section,
  .feature-section.reverse {
    flex-direction: column;
    gap: 24px;
  }
  .section-img { flex: none; max-width: 100%; width: 100%; }
}

/* =========================================
   9. ニュース
   ========================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--white-warm);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s, box-shadow 0.3s;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(26,18,8,0.22);
}

.news-thumb {
  position: relative;
  overflow: hidden;
}
.news-thumb img {
  width: 100%; height: 180px; object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s;
}
.news-card:hover .news-thumb img { transform: scale(1.04); }

.news-tag {
  position: absolute;
  top: 10px; left: 10px;
  font-family: "MisakiMincho", serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}
.news-tag.update { background: #1b8fc4; color: #fff; }
.news-tag.event  { background: var(--gold); color: #fff; }
.news-tag.dev    { background: var(--ink-soft); color: var(--gold-pale); }

.news-body { padding: 18px 20px 22px; }
.news-date {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.news-title { font-size: 1.05rem; margin: 0 0 10px; }
.news-body p { font-size: 0.9rem; color: var(--ink-mid); margin: 0; }

/* =========================================
   10. 世界観
   ========================================= */
.world-intro {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
  font-size: 1rem;
  color: var(--ink-mid);
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.world-card {
  background: var(--white-warm);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s;
}
.world-card:hover { transform: translateY(-4px); }

.world-img-wrap img {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: 0;
}

.world-text { padding: 20px 22px 24px; }
.world-name { font-size: 1.2rem; margin: 0 0 10px; color: var(--gold); }
.world-text p { font-size: 0.92rem; color: var(--ink-mid); margin: 0; }

/* =========================================
   11. キャラクター・種族
   ========================================= */
.section-block {
  text-align: center;
  margin: 60px 0 28px;
}
.section-heading { font-size: 1.8rem; margin-bottom: 10px; }
.section-desc {
  font-size: 0.97rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* 種族カード */
.race-section { margin: 0; }

.race-item {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 36px 0;
  border-bottom: 1px dashed rgba(201,150,42,0.35);
}
.race-item:last-child { border-bottom: none; }
.race-item:nth-child(even) { flex-direction: row-reverse; }

.race-text { flex: 1; }

.race-name {
  font-size: 1.3rem;
  color: #fff;
  background: var(--ink);
  display: inline-block;
  padding: 5px 18px;
  border-radius: 5px;
  margin: 0 0 12px;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: 0.1em;
}

.race-text p { color: var(--ink-mid); font-size: 0.93rem; margin: 0 0 14px; }

/* ステータスバー */
.stat-bar-wrap { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.stat-bar { display: flex; align-items: center; gap: 10px; }
.stat-label {
  font-family: "MisakiGothic", serif;
  font-size: 12px;
  font-weight: 700;
  width: 40px;
  color: var(--gold);
  text-align: right;
  flex-shrink: 0;
}
.stat-track {
  flex: 1;
  height: 8px;
  background: rgba(201,150,42,0.2);
  border-radius: 4px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  animation: fillBar 1.4s cubic-bezier(0.22,1,0.36,1) forwards;
  transform-origin: left;
}
@keyframes fillBar {
  from { width: 0 !important; }
}

.race-image {
  flex: 0 0 42%;
  max-width: 42%;
}
.race-image img {
  width: 100%; height: auto;
  border-radius: var(--radius);
  filter: drop-shadow(0 8px 16px rgba(26,18,8,0.2));
}

@media (max-width: 680px) {
  .race-item,
  .race-item:nth-child(even) {
    flex-direction: column;
    gap: 20px;
  }
  .race-image { flex: none; max-width: 80%; width: 80%; margin: 0 auto; }
}

/* =========================================
   12. ジョブグリッド
   ========================================= */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.job-card {
  background: var(--white-warm);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.job-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--gold);
}
.job-card h4 {
  font-size: 0.98rem;
  color: var(--gold);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(201,150,42,0.4);
}
.job-card p {
  font-size: 0.87rem;
  color: var(--ink-mid);
  margin: 0;
  line-height: 1.65;
}

/* =========================================
   13. ダンジョン
   ========================================= */
.dungeon-intro {
  background: var(--white-warm);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-soft);
}
.dungeon-intro p { color: var(--ink-mid); margin: 0 0 12px; }
.dungeon-intro p:last-child { margin: 0; }

.info-badge {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(201,150,42,0.12);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* =========================================
   14. ポモドーロサイクル
   ========================================= */
.pomo-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
  font-size: 1rem;
  color: var(--ink-mid);
}

.pomo-cycle {
  text-align: center;
  background: var(--white-warm);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  margin-top: 60px;
  box-shadow: var(--shadow-card);
}
.pomo-cycle .dq-title { margin-bottom: 28px; }

.cycle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.cycle-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 80px;
}
.cycle-icon {
  font-size: 2rem;
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201,150,42,0.15);
  border: 2px solid var(--gold-pale);
  border-radius: 50%;
}
.cycle-label {
  font-family: "MisakiMincho", serif;
  font-size: 0.85rem;
  color: var(--ink-mid);
  font-weight: 700;
}
.cycle-arrow {
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
  padding-bottom: 22px;
}

.cycle-desc {
  font-size: 0.97rem;
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================
   15. フッター
   ========================================= */
#footer.page {
  text-align: center;
}

.footer-visual {
  max-width: 560px;
  margin: 0 auto 40px;
  filter: drop-shadow(0 10px 22px rgba(26,18,8,0.2));
}

.footer-cta {
  margin-bottom: 40px;
}
.footer-tagline {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 12px;
}

.footer-copy {
  padding-top: 28px;
  border-top: 1px solid rgba(201,150,42,0.3);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* =========================================
   16. ユーティリティ
   ========================================= */
@media (max-width: 480px) {
  .page { padding: 40px 16px 60px; }
  .dq-title { font-size: 1.4rem; }
  .hero .dq-title { font-size: 1.6rem; }
  .job-grid { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .world-grid { grid-template-columns: 1fr; }
  .cycle-arrow { display: none; }
  .cycle-row { gap: 16px; }
}
