:root {
  --bg: #0f1d18;
  --text: #e0e5e8;
  --accent: #00ffa0;
  --accent2: #00ffd7;
  --border-thin: hsla(156, 26%, 42%, 0.2);
  --border-thick: rgba(62, 100, 67, 0.2);
  --transition: 0.4s ease;
}
[data-theme="light"] {
  --bg: #ffffff;
  --text: #222222;
  --accent: #007f5f;
  --accent2: #005f3f;
  --border-thin: rgba(0,0,0,0.07);
}

body {
  margin: 0;
  padding: 0;
  /* Solid background color */
  background-color: var(--bg);
  /* CSS Grid Overlay: minor and major lines */
  background-image:
    /* Minor grid lines */
    repeating-linear-gradient(90deg, var(--border-thin) 1px, transparent 2px, transparent 47px),
    repeating-linear-gradient(0deg,  var(--border-thin) 1px, transparent 2px, transparent 47px),
    /* Major grid lines */
    repeating-linear-gradient(90deg, var(--border-thick) 2px, transparent 3px, transparent 248px),
    repeating-linear-gradient(0deg,  var(--border-thick) 2px, transparent 3px, transparent 248px);
  /* Grid spacing */
  background-size: 48px 48px, 48px 48px, 250px 250px, 250px 250px;
  background-position: 0, 0, 125px, 125px;
  background-repeat: repeat;

  color: var(--text);
  font-family: 'Inter','Open Sans', sans-serif;
  overflow-x: hidden;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 94%;
  margin: 2rem auto;
  padding: 2rem;
  background-color: rgba(13, 15, 16, 0.85);
  border: 1px solid var(--accent2);
  border-radius: 16px;
  box-shadow:
    0 0 8px var(--accent2),
    0 0 16px rgba(0, 255, 215, 0.6);
  box-sizing: border-box;
  overflow: visible;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .wrapper {
    margin: 1rem auto;
    max-width: calc(100% - 2rem);
    padding: 1rem;
  }
}

/* 画面上下にフェードオーバーレイを重ねる */
.wrapper::before,
.wrapper::after {
  content: "";
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;         /* wrapper と同じ幅 */
  pointer-events: none;
  z-index: 0;
}

/* 上部フェード（透過→不透明） */
.wrapper::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(13,15,16,1) 0%,
    rgba(13,15,16,0) 100%
  );
  height: 40vh;
}

/* 下部フェード（不透明→透過） */
.wrapper::after {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(13,15,16,1) 0%,
    rgba(13,15,16,0) 100%
  );
  height: 40vh;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;    /* 垂直中央 */
  align-items: center;        /* 水平中央 */
  text-align: center;

  /* ビュー全体を使う */
  height: 100vh;              /* ヘッダーも含めた高さになるので、必要なら調整 */
  padding: 0;                 /* 上下の余白はゼロで */
  box-sizing: border-box;
}

.hero .content {
  max-width: 800px;
  transform: translateY(-40%);
}
.hero h1 {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}
.btn-primary {
  padding: 1rem 2rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}
.btn-primary:hover {
  transform: scale(1.05);
}
.btn-primary:hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(0,255,160,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 0.6s forwards;
}
@keyframes pulse {
  to { width: 200%; height: 200%; opacity: 0; }
}

/* Sections */
.section {
  padding: 4rem 2rem;
  z-index: 3;
}
.section h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--accent2);
  margin-bottom: 2rem;
}

/* Cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
}
.card {
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--accent2);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  width: 300px;
  transition: transform var(--transition), background var(--transition);
  position: relative;
}
.card:hover {
  background: rgba(0,0,0);
  transform: translateY(-8px);
}
.card-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cards .card {
  flex: 0 0 260px;      
  position: relative; /* リボン用に position を relative に */
  overflow: visible;  /* はみ出しを許可 */
  display: flex;
  flex-direction: column;   /* 中身を縦並びに */
  justify-content: space-between; /* 上下に余白を振り分け */
  min-height: 250px;        /* 高さ350pxを最小値に */
}

/* Sections */
.section { padding:4rem 2rem; z-index:3; }
.section h2 {
  text-align:center; font-size:2.5rem;
  color:var(--accent2); margin-bottom:2rem;
}

/* Cards */
.cards {
  display:flex; flex-wrap:wrap; gap:3rem;
  justify-content:center; position:relative; z-index:1;
}
.card {
  position:relative; overflow:visible;
  display:flex; flex-direction:column; justify-content:space-between;
  background:rgba(0,0,0,0.7); border:1px solid var(--accent2);
  padding:2rem; border-radius:12px; width:260px;
  min-height:250px;
  transition:transform var(--transition),background var(--transition);
}
.card:hover { background:rgba(0,0,0); transform:translateY(-8px); }
.card-icon { font-size:2.5rem; color:var(--accent); margin-bottom:1rem; }

/* Search */
#module-search {
  display:block; margin:1.5rem auto 2rem;
  padding:.75rem 1rem; width:100%; max-width:400px;
  border-radius:4px; border:1px solid var(--accent2);
  background:rgba(0,0,0,0.3); color:var(--text);
  font-size:1rem;
}
#module-search::placeholder { opacity:.7; }

/* Pricing cards */
.pricing-cards {
  display:flex; 
  flex-wrap:nowrap; 
  overflow-x:auto;
  gap:1rem; 
  padding-bottom:1rem; 
  align-items:stretch;
  height:600px;
}
.pricing-card h3 { margin:0 0 1rem; }
.pricing-card .plan-price { display:flex; align-items:baseline; justify-content:center;
  gap:.25rem; font-size:2rem; font-weight:700; margin:0 0 1rem;
}
.pricing-card ul {
  display: block;
  list-style:disc inside; 
  margin: 0.5rem 0;  
  padding: 0 5%; 
  padding-left:1.5rem; 
  width:100%;
  margin-bottom:1rem; 
  line-height:1.4;
  text-align: left;
  box-sizing: border-box;
  list-style-position: inside;
  word-wrap: break-word;
}
.pricing-card ul li { 
  margin-bottom: 0.05rem;  /* 項目間をさらに狭く */
  line-height: 1.3;        /* 行間も少し詰める */
}

/* ──── リボン用ラッパー ──── */
.pricing-card {
  display: flex ;
  min-height: 550px;
  flex-direction: column ;
  position: relative; /* リボンを絶対配置するため */
  overflow: visible;  /* はみ出しを許可 */
}

/* ラッパー自体は大きさゼロ、擬似要素のためのコンテナ */
.pricing-card .ribbon-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

/* リボンをはみ出して見せるコンテンツ領域 */
.pricing-card .ribbon-content {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 100px;  /* お好みで調整 */
  height: 100px; /* お好みで調整 */
  overflow: hidden;
}

.pricing-card .ribbon2 {  
  display: inline-block;
  position: absolute;
  top: 0;
  right: 10px;
  margin: 0;
  padding: 10px 0;
  z-index: 2;
  width: 40px;
  text-align: center;
  font-size: 17px;
  color: white;
  background: #ff785b;
}

.pricing-card .ribbon2:after {
  content: '';
  position: absolute;
  left: 0;
  top: 100%;
  height: 0;
  width: 0;
  border-left: 20px solid #ff785b;
  border-right: 20px solid #ff785b;
  border-bottom: 10px solid transparent;
}

/* 実際に回転して見える部分 */
.pricing-card .ribbon-text {
  display: inline-block;
  position: absolute;
  top: 22px;
  left: -23px;
  padding: 7px 0;
  width: 160px;           /* リボンの長さ */
  text-align: center;
  font-size: 0.75rem;
  line-height: 1;
  background: var(--accent2);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0.05em;
  transform: rotate(45deg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* リボン端の三角飾り */
.pricing-card .ribbon-text::before,
.pricing-card .ribbon-text::after {
  content: "";
  position: absolute;
  border-top: 4px solid #d14d96; /* 少し濃い影色 */
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  bottom: -4px;
}
.pricing-card .ribbon-text::before {
  left: 17px;
  z-index: 0;
}
.pricing-card .ribbon-text::after {
  right: 5px;
}

/* 年額モード時のみ表示 */
.pricing-card:not(.yearly) .ribbon-wrapper { display: none; }

/* ──── Pricing-card Flip ──── */
/* カード要素自体に遠近感を持たせる */
.pricing-card {
  perspective: 1000px;
  /* フリップのトランジションをここで付与 */
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

/* .flipped クラスが付いたら裏返す */
.pricing-card.flipped {
  transform: rotateY(180deg);
}

/* 表面／裏面ともに同じサイズで重ねる */
.pricing-card .card-face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 1.5rem;
}

/* 裏面だけ180度回転しておく */
.pricing-card .card-back {
  transform: rotateY(180deg);
}

/* 価格プランの説明文強調 */
.plan-desc {
  position: relative;
  white-space: pre-wrap;
  text-align: center;
  padding: 1rem 1rem 1rem 1.5rem;
  width: 80%;
  margin-left: 1rem;
  margin-right: 1rem;
  margin-bottom: 1rem;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.0;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
}

.plan-desc::before {
  position: absolute;
  left: 0.2rem;
  top: 1rem;
  font-weight: bold;
  color: var(--accent2);
}

/* ──── カード自体をフレックスコンテナに ──── */
.pricing-card {
  display: flex;
  flex-direction: column;
  /* スマートフォン表示でカードの内容が切れないよう高さを確保 */
  min-height: 550px;
}

/* ──── 表裏それぞれを中身で伸びるように ──── */
.pricing-card .card-face {
  display: flex;
  flex-direction: column;
  flex: 1;                  /* 親の高さを占有 */
  box-sizing: border-box;
}

/* ──── CTA 部分を下端に固定 ──── */
.pricing-card .plan-cta {
  margin-top: auto;         /* 上の要素が押し上げる */
  text-align: center;
  position: relative;
  z-index: 2;
  padding-top: 0;           /* 大きすぎた余白を削除 */
}

/* ──── ボタン／現在プラン表示 ──── */
.pricing-card .plan-cta .btn-get,
.pricing-card .plan-cta .current-plan {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.pricing-card .plan-cta .btn-get {
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: background .3s;
}
.pricing-card .plan-cta .btn-get:hover {
  background: var(--accent2);
  opacity: 0.9;
}

.pricing-card .plan-cta .current-plan {
  background: var(--border-thick);
  color: var(--text);
  border: 2px solid var(--accent2);
  cursor: default;
}

/* ─── スマホ版：スタック表示 ─── */
@media (max-width: 768px) {
  .pricing-cards {
    position: relative;
    display: block;
    height: 600px;
    overflow: hidden !important;
  }
  .pricing-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .pricing-card.swipe-left {
    transform: translateX(-110%) rotate(-5deg) scale(0.9);
    transition: transform 0.3s;
  }
}

/* Search Input */
#module-search {
  display: block;
  margin: 1.5rem auto 2rem;
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
  border: 1px solid var(--accent2);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}
#module-search::placeholder {
  color: var(--text);
  font-family: 'Inter', sans-serif;
  opacity: 0.7;
}

/* Pricing Toggle */
.toggle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.toggle button {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent2);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.toggle button.active {
  background: var(--accent);
  color: var(--bg);
}

/* Animations */
.radial-reveal {
  clip-path: circle(0 at 50% 50%);
  animation: reveal 1s ease-out forwards;
}
@keyframes reveal {
  to { clip-path: circle(200% at 50% 50%); }
}
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Particles */
#particles-js {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: transparent !important;
  z-index: -3 !important;
}
#particles-js canvas {
  background: transparent !important;
}

/* Module node-line canvas */
.module-card canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wrapper,
.pricing-cards,
#pricing,
.section,
.reveal,
.pricing-card {
  overflow: visible !important;
}
.wrapper .section,
.wrapper .cards {
  position: relative;
  z-index: 100;
}

@media (max-width: 768px) {
  .pricing-cards { overflow: hidden !important; }
}

/* Login page */
.login-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-thick);
  border-radius: 12px;
}
.login-container label {
  display: block;
  margin-top: 1rem;
  text-align: left;
}
.login-container input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border-thin);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
.login-links {
  margin-top: 1rem;
}
.login-links a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 0.5rem;
}
.login-links a:hover {
  text-decoration: underline;
}
.social-logins {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.social-logins a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-thick);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.social-logins a.google:hover {
  background: #db4437;
  color: #fff;
}
.social-logins a.twitter:hover {
  background: #1da1f2;
  color: #fff;
}
.social-logins a.discord:hover {
  background: #5865f2;
  color: #fff;
}
.social-logins a.twitch:hover {
  background: #9146ff;
  color: #fff;
}

.error {
  color: #ff6b6b;
  margin-top: 0.5rem;
  text-align: center;
}
.site-footer {
  margin-top: 3em;
  text-align: center;
  color: #888;
}
.site-footer a {
  color: #888;
  margin: 0 0.5em;
  text-decoration: none;
}
