/* 外観の更新(2026-10-15、0.8.0)。style.css・fx.css の上に重ねる。
   浮いたピル型のナビ、方眼紙の背景、極太の見出し、購入先カード、波打つ箱庭の地形、約束の帯。 */

/* ---- 浮いたナビ ---- */
.nav-header {
  top: 10px;
  max-width: 1040px;
  margin: 10px auto 0;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 14px 30px -20px rgba(22, 34, 44, 0.55);
}

.is-home .nav-header {
  border-radius: 999px;
}

@media (max-width: 1080px) {
  .nav-header {
    margin-inline: 12px;
  }
}

/* ---- 方眼紙の背景 ----
   グラデーションを使わず、40pxの格子を、線の形のマスクで切り抜いて描く(色は --line でテーマに従う) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--line);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 .5H40M.5 0V40' stroke='black' fill='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 .5H40M.5 0V40' stroke='black' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: 40px 40px;
  mask-size: 40px 40px;
  -webkit-mask-position: -1px -1px;
  mask-position: -1px -1px;
  pointer-events: none;
}

/* ---- ヒーロー ---- */
.hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  padding: 44px 40px;
}

.hero-inner {
  max-width: 560px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9em, 4.4vw, 2.9em);
  font-weight: 900;
  line-height: 1.22;
}

.hero h1 .h1-line {
  display: block;
}

.hero h1 .h1-line:last-child {
  color: var(--moss);
}

.hero-sub {
  margin: 0 0 14px;
  font-size: 1.2em;
  font-weight: 900;
}

.hero-sub mark {
  line-height: 1.6;
  padding: 0 6px;
  color: var(--ink);
  box-shadow: inset 0 -0.45em 0 var(--amber);
}

/* 見出しの行が、順に立ち上がる */
.hero h1 .h1-line {
  animation: fx-rise 0.4s ease-out both;
}

.hero h1 .h1-line:last-child {
  animation-delay: 0.14s;
}

/* ---- 購入先プレイヤーのカード ---- */
.buyer-card {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1.5px solid var(--moss);
  border-radius: var(--radius-lg);
  background: var(--mist);
  box-shadow: 4px 4px 0 var(--moss);
}

.buyer-title {
  display: block;
  margin: 0 0 8px;
  font-size: 0.82em;
  font-weight: 900;
  color: var(--moss);
}

.buyer-row {
  display: flex;
  gap: 8px;
}

.buyer-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 1em;
}

.buyer-row button {
  flex-shrink: 0;
  padding: 9px 18px;
}

.buyer-note {
  margin: 8px 0 0;
  font-size: 0.8em;
  color: var(--light-text);
}

.buyer-note strong {
  color: var(--ink);
  font-family: var(--font-mono);
}

/* ---- 波打つ箱庭の地形 ---- */
.hero-stage {
  height: 320px;
  overflow: hidden;
  perspective: none;
}

.terrain {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform:
    rotateX(58deg)
    rotateZ(calc(-45deg + var(--px, 0) * 8deg));
  transition: transform 0.2s ease-out;
}

.terrain .t {
  --s: 34px;
  --h: 26px;
  position: absolute;
  left: calc((var(--x) - 3) * var(--s));
  top: calc((var(--y) - 3) * var(--s));
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  background: color-mix(in srgb, var(--moss) 38%, var(--voxel-top));
  border: 1px solid rgba(22, 34, 44, 0.16);
  animation: terrain-wave 4.6s ease-in-out infinite;
  animation-delay: var(--d);
}

.terrain .t1 { background: color-mix(in srgb, var(--moss) 28%, var(--voxel-top)); }
.terrain .t2 { background: color-mix(in srgb, var(--moss) 48%, var(--voxel-top)); }
.terrain .t3 { background: color-mix(in srgb, var(--amber) 30%, var(--voxel-top)); }

.terrain .t::before,
.terrain .t::after {
  content: "";
  position: absolute;
  background: var(--voxel-left);
  border: 1px solid rgba(22, 34, 44, 0.16);
  backface-visibility: hidden;
}

.terrain .t::before {
  left: -1px;
  top: 100%;
  width: calc(100% + 2px);
  height: var(--h);
  margin-top: 1px;
  transform-origin: top;
  transform: rotateX(-90deg);
}

.terrain .t::after {
  left: 100%;
  top: -1px;
  width: var(--h);
  height: calc(100% + 2px);
  margin-left: 1px;
  background: var(--voxel-right);
  transform-origin: left;
  transform: rotateY(90deg);
}

@keyframes terrain-wave {
  0%, 100% { transform: translateZ(0); }
  50% { transform: translateZ(18px); }
}

/* 地形の上の箱は、地形の外で回る */
.hero-stage .voxel-lg {
  position: relative;
  z-index: 2;
  margin-top: -40px;
}

.hero-stage .spark {
  z-index: 3;
}

/* ---- 約束の帯 ---- */
.promise-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.promise-band li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.promise-band strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1.02em;
  font-weight: 900;
}

.promise-band span {
  font-size: 0.82em;
  color: var(--light-text);
}

.page > .promise-band {
  animation: fx-rise 0.4s 0.04s ease-out both;
}

/* ---- 商品: ガチャと期間限定は大きく ---- */
.product-grid {
  grid-auto-flow: dense;
}

@media (min-width: 761px) {
  .product-card[data-category="gacha"] {
    grid-column: span 2;
  }
}

/* ---- スマホ ---- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 26px 20px;
  }

  .hero-stage {
    height: 250px;
  }

  .terrain .t {
    --s: 28px;
  }

  .promise-band {
    grid-template-columns: 1fr;
  }

  .is-home .nav-header {
    border-radius: 28px;
  }
}

/* ---- 動きを減らす ---- */
@media (prefers-reduced-motion: reduce) {
  .terrain .t,
  .hero h1 .h1-line,
  .hero-sub mark,
  .page > .promise-band {
    animation: none !important;
  }

  .terrain {
    transition: none;
  }
}

/* 年齢の申告(生年月の選択) */
.age-birth {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 14px;
}

.age-birth select {
  padding: 9px 12px;
  font-size: 1em;
}

/* ---- 購入前の同意事項(カート) ---- */

.consent-box {
  border: 1px solid var(--inner);
  border-radius: var(--radius-md);
  background: var(--paper);
  padding: 14px 18px;
  margin: 0 0 18px;
}

.consent-box legend {
  font-weight: 700;
  padding: 0 8px;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--inner);
  font-size: 0.92em;
  line-height: 1.7;
  cursor: pointer;
}

.consent-item:first-of-type {
  border-top: 0;
}

.consent-item input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: var(--moss);
}

.consent-links {
  display: block;
  margin-top: 4px;
}

.consent-links a {
  margin-right: 14px;
  white-space: nowrap;
}

/* サーバーのオンライン表示(0.12.0)。ヘッダー右上の小さなバッジ */
.server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.server-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9a9a9a;
}
.server-status[data-state="online"] i { background: #2f9e5b; }
.server-status[data-state="offline"] i { background: #c8452d; }
