:root {
  --primary-bg: #1a0b2e;
  --secondary-bg: #2d1b4e;
  --accent-gold: #c5a059;
  --accent-glow: #ffd700;
  --text-light: #f0f0f0;
  --text-dim: #b8b8b8;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Noto Serif JP", serif;
  background-color: var(--primary-bg);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  line-height: 1.8;
  background-image: radial-gradient(
    circle at 50% 50%,
    #2a1b3d 0%,
    #1a0b2e 100%
  );
}

h2,
h3 {
  font-family: "Cinzel", serif;
  font-weight: 700;
  margin: 0;
}

/* --- Navigation & Logo --- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  z-index: 1000;
  background: rgba(26, 11, 46, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(197, 160, 89, 0.2);
}

.logo-link {
  display: block;
  width: 50px;
  height: 50px;
  transition: transform 0.3s;
  cursor: pointer;
  will-change: transform;
}

.logo-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(197, 160, 89, 0.5));
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ppd-logo {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 0 3px rgba(197, 160, 89, 0.3));
}

.logo-link:hover {
  transform: scale(1.1);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
}

.main-nav a {
  text-decoration: none;
  color: var(--accent-gold);
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  text-transform: uppercase;
}

.main-nav a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--accent-gold);
}

/* --- Hero Section --- */
header {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(197, 160, 89, 0.2);
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* パス修正: cssフォルダから見てimagesフォルダへのパス */
  background-image: url("../images/Potential_Power.png");
  background-repeat: repeat; /* 背景を繰り返してシームレスに */
  background-attachment: fixed; /* 背景をビューポートに固定し、パララックス効果を出す */
  background-position: center;
  opacity: 0.3;
  z-index: -1;
}

h1 {
  font-family: "Shippori Mincho", serif;
  font-weight: 700;

  /* サイズと行間 */
  font-size: 2.5rem;
  line-height: 1.2;

  /* 文字色：白からゴールドへのグラデーションで「特別感」を */
  background: linear-gradient(to bottom, #ffffff 30%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  will-change: transform;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  will-change: transform;
}

.english-title {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  color: var(--accent-gold);
  letter-spacing: 0.2em;
  opacity: 0.6;
  margin-bottom: 5px;
  text-transform: uppercase;
}

/* --- Logic Explanation Section --- */
.logic-section {
  background: linear-gradient(
    180deg,
    var(--primary-bg) 0%,
    var(--secondary-bg) 100%
  );
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.logic-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* パス修正 */
  background-image: url("../images/Potential_Power.png");
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;
  opacity: 0.3;
  pointer-events: none;
}

.logic-section > * {
  position: relative;
  z-index: 1;
}

.section-title {
  color: var(--accent-gold);
  font-size: 1.4rem;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  display: block;
  width: 420px;
  height: 2px;
  background: var(--accent-gold);
  margin: 10px auto 0;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.logic-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.2);
  padding: 30px;
  border-radius: 8px;
  transition: transform 0.3s;
}

.logic-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.05);
}

.logic-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--accent-gold);
}

.logic-math {
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 0;
}

/* --- Form Section --- */
.container {
  max-width: 700px;
  margin: 50px auto;
  padding: 40px;
  background: rgba(20, 10, 30, 0.8);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.container::before {
  content: "◆";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-gold);
  background: var(--primary-bg);
  padding: 0 10px;
}

.form-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-gold);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

input,
select {
  width: 100%;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #4a3b5e;
  color: white;
  font-family: "Noto Serif JP", serif;
  font-size: 1rem;
  border-radius: 4px;
  transition: border-color 0.3s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.5);
}

button.btn-analyze {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #967bb6, #d4af37);
  border: none;
  color: #1a0b2e;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

button.btn-analyze:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* --- Result Section --- */
#result-section {
  display: none;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(197, 160, 89, 0.3);
  text-align: center;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-combo {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 10px;
}

.combo-highlight {
  color: var(--accent-gold);
  font-weight: bold;
  font-family: "Cinzel", serif;
}

.rank-large {
  font-family: "Cinzel", serif;
  font-size: 4rem;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(197, 160, 89, 0.6);
  line-height: 1;
  margin: 20px 0;
}

/* --- SVG Radar Chart Styles --- */
.chart-container {
  margin: 30px auto 10px;
  /* 下マージンを少し減らしてボタンとの距離を調整 */
  max-width: 450px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

.radar-chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

svg.radar-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}

/* グリッド線 */
.grid-poly {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 0.5;
}

.axis-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.5;
}

/* メインのデータグラフ */
.data-poly {
  fill: rgba(212, 175, 55, 0.3);
  stroke: var(--accent-gold);
  stroke-width: 2;
  transition: all 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ラベル */
.chart-label {
  position: absolute;
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-family: "Cinzel", serif;
  text-align: center;
  width: 60px;
  margin-left: -30px;
  text-shadow: 0 0 2px #000;
}

.lbl-top {
  top: 2%;
  left: 50%;
}

.lbl-tr {
  top: 30%;
  left: 95%;
}

.lbl-br {
  top: 85%;
  left: 80%;
}

.lbl-bl {
  top: 85%;
  left: 20%;
}

.lbl-tl {
  top: 30%;
  left: 5%;
}

/* --- New: View More Button --- */
.btn-view-more {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 25px;
  border: 1px solid var(--accent-gold);
  background: transparent;
  color: var(--accent-gold);
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  z-index: 10;
}

.btn-view-more:hover {
  background: rgba(197, 160, 89, 0.2);
  letter-spacing: 0.1em;
}

/* --- New: Parameter Details Section --- */
.param-details {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.param-intro {
  text-align: center;
  margin-bottom: 30px;
  color: #ddd;
  font-size: 0.95rem;
}

.param-item {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.param-item:last-child {
  border-bottom: none;
}

.param-title {
  color: var(--accent-gold);
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.param-title::before {
  content: "◆";
  font-size: 0.8em;
  margin-right: 10px;
}

.param-desc {
  font-size: 0.9rem;
  color: #ccc;
  margin: 5px 0;
  padding-left: 20px;
  line-height: 1.6;
}

.param-label {
  color: #fff;
  font-weight: bold;
  margin-right: 5px;
}

footer {
  text-align: center;
  padding: 40px;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Utility Classes for Responsive Line Breaks */
.sp-only {
  display: none;
}
.pc-only {
  display: inline;
}

/* Catch Copy Style inside H1 */
h1 .catch-copy {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.2em;
  font-family: "Shippori Mincho", serif;
  font-weight: 700;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  h1 .catch-copy {
    font-size: 1rem;
  }

  .container {
    padding: 20px;
    margin: 20px;
    width: auto;
  }

  .logic-math {
    font-size: 1.2rem;
  }

  .chart-label {
    font-size: 0.65rem;
  }

  .sp-only {
    display: inline;
  }
  .pc-only {
    display: none;
  }

  .section-title {
    display: block;
    width: 100%;
  }

  .section-title::after {
    width: 200px;
  }

  /* Mobile Nav Adjustments */
  .nav-bar {
    padding: 15px;
  }
  .logo-link {
    width: 40px;
    height: 40px;
  }
  .logo-group {
    gap: 8px;
  }
  .ppd-logo {
    height: 20px;
  }
  .main-nav ul {
    gap: 15px;
  }
}