/*
Theme Name: 貿易すごろく
Theme URI: https://example.com/
Author: HPS CONNECT / Jaspire LLC
Description: 貿易すごろく公式サイト用オリジナルテーマ
Version: 4.5
Text Domain: boeki-sugoroku
*/

@import url('https://fonts.googleapis.com/css2?family=Kaisei+Decol:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=DotGothic16&display=swap');

:root {
  --ink: #16233F;
  --ink-soft: #4A6478;
  --paper: #EAF4F7;
  --paper-light: #FFFFFF;
  --gold: #E8A23D;
  --gold-deep: #C7822A;
  --vermilion: #C01A2D;
  --teal: #37AC9C;
  --blue: #4182CB;
  --purple: #8A3FA4;
  --orange: #F25C21;
  --tan: #BF935B;
  --sky: #69B9D4;
  --land: #E3E46A;
  --white: #FFFFFF;

  --font-display: 'Kaisei Decol', serif;
  --font-body: 'Zen Kaku Gothic New', sans-serif;
  --font-mono: 'DotGothic16', monospace;

  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 28px;
  --shadow-card: 0 6px 0 rgba(22,35,63,0.12), 0 10px 24px rgba(22,35,63,0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-light);
  border-bottom: 3px solid var(--ink);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .logo-dice {
  display: inline-block;
  width: 30px;
  height: auto;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper-light);
}

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: 3px solid var(--ink);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle-btn span {
  display: block;
  width: 20px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-btn.open span:nth-child(2) { opacity: 0; }
.nav-toggle-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-panel {
  display: none;
  flex-direction: column;
  background: var(--paper-light);
  border-top: 3px solid var(--ink);
}
.mobile-nav-panel.open { display: flex; }
.mobile-nav-panel a {
  padding: 16px 24px;
  font-weight: 700;
  border-bottom: 1px solid rgba(22,35,63,0.12);
}
.mobile-nav-panel a[aria-current="page"] { background: var(--ink); color: var(--paper-light); }

@media (max-width: 720px) {
  .nav-toggle-btn { display: flex; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.98rem;
  padding: 14px 28px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary {
  background: var(--vermilion);
  color: var(--paper-light);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }

.btn-secondary {
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-secondary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 40px;
  overflow: hidden;
  position: relative;
  background-image:
    linear-gradient(to right, var(--paper-light) 0%, rgba(255,255,255,0.7) 32%, rgba(255,255,255,0.1) 68%, rgba(255,255,255,0) 100%),
    url('img/board/board-map.jpg?v=4');
  background-size: auto 145%;
  background-position: right -60px center;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--ink) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.035;
  pointer-events: none;
}

.hero-doodle {
  position: absolute;
  opacity: 0.9;
  pointer-events: none;
}
.hero-doodle svg { width: 100%; height: 100%; }
.hero-doodle.d1 { top: 6%; left: 2%; width: 46px; transform: rotate(-12deg); }
.hero-doodle.d2 { top: 68%; left: 6%; width: 34px; transform: rotate(14deg); }
.hero-doodle.d3 { top: 14%; right: 3%; width: 40px; transform: rotate(8deg); }

.hero .wrap {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: var(--paper-light);
  padding: 4px 12px;
  border-radius: 4px;
  transform: rotate(-2deg);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.35;
  margin: 0 0 20px;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .hero h1 { white-space: normal; }
}

.hero h1 .accent { color: var(--vermilion); }

.hero p.lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 46ch;
}

.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Board Track (signature element) ---------- */

.board-track-frame {
  background: var(--ink);
  border-radius: var(--radius-l);
  padding: 28px;
  position: relative;
}

.board-track-frame .caption {
  font-family: var(--font-mono);
  color: var(--paper);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 14px;
  letter-spacing: 0.04em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--paper);
  font-family: var(--font-mono);
}

.legend-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}

/* colors keyed to board categories */
.c-start { background: var(--vermilion); }
.c-economy { background: var(--teal); }
.c-transport { background: var(--blue); }
.c-personnel { background: var(--orange); }
.c-disaster { background: var(--purple); }
.c-airport { background: var(--tan); }
.c-strike { background: var(--vermilion); }
.c-lost { background: #4A4A4A; }
.c-plain { background: rgba(242,232,207,0.25); }

/* ---------- Section headings ---------- */

section { padding: 56px 0; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }

.section-head .eyebrow { display: inline-block; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 12px;
}

.section-head p { color: var(--ink-soft); margin: 0; }

/* ---------- Overview stat cards ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 780px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  padding: 22px 18px;
  box-shadow: var(--shadow-card);
}

.stat-card .num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: var(--vermilion);
  line-height: 1;
}

.stat-card .icon-badge {
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
}
.stat-card .icon-badge svg { width: 100%; height: 100%; }

.stat-card .label { font-weight: 700; margin-top: 8px; font-size: 0.95rem; }

/* ---------- Contents table ---------- */

.contents-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.contents-table th, .contents-table td {
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(22,35,63,0.15);
}

.contents-table th {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: rgba(22,35,63,0.04);
}

.contents-table tr:last-child td { border-bottom: none; }

.contents-table td.qty {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--vermilion);
  text-align: right;
}

/* ---------- Card grid (used on cards.html) ---------- */

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}

.tab-btn {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--paper-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-btn .tab-icon { width: 20px; height: 20px; flex-shrink: 0; }
.tab-btn .tab-icon svg { width: 100%; height: 100%; }

.tab-btn.active { background: var(--ink); color: var(--paper-light); }

.subfilter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.subfilter button {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink-soft);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.subfilter button.active { background: var(--ink-soft); color: var(--paper-light); border-color: var(--ink-soft); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  align-items: start;
}

.game-card {
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease;
}
.game-card:hover { transform: translateY(-3px); }

.game-card .cat-tag {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--paper-light);
}

.game-card .cat-tag.tag-transport { background: var(--blue); }
.game-card .cat-tag.tag-economy { background: var(--teal); }
.game-card .cat-tag.tag-disaster { background: var(--purple); }
.game-card .cat-tag.tag-personnel { background: var(--orange); }
.game-card .cat-tag.tag-goods { background: var(--ink-soft); }

.game-card .no {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 0;
  line-height: 1.4;
}

.game-card .effect {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.65em * 4);
}

.game-card .tap-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: right;
  margin-top: -4px;
}

.game-card .amt-pos { color: var(--teal); font-weight: 900; }
.game-card .amt-neg { color: var(--vermilion); font-weight: 900; }

.game-card .no-inline {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-right: 8px;
}

.game-card .flag { font-size: 1.6rem; }

.goods-icon-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.goods-icon-row .goods-icon {
  width: 56px;
  height: 56px;
}

.goods-icon-row .goods-icon svg {
  width: 100%;
  height: 100%;
}

.goods-icon-row .flag { font-size: 1.5rem; }

.goods-card-img-wrap {
  position: relative;
  margin: -18px -18px 0;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
}

.goods-card-img-wrap img {
  width: 100%;
  aspect-ratio: 0.6756;
  object-fit: cover;
  background: #fff;
  object-position: center;
  display: block;
  transition: transform 0.2s ease;
}

.game-card:hover .goods-card-img-wrap img { transform: scale(1.05); }

.goods-card-img-wrap .flag-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  background: var(--paper-light);
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
}

.game-card .price-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.price-box {
  flex: 1;
  background: var(--paper);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  text-align: center;
}

.price-box .k { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft); }
.price-box .v { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; }
.price-box.sell .v { color: var(--vermilion); }

.avoid-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  border-top: 1px dashed rgba(22,35,63,0.2);
  padding-top: 8px;
  margin-top: 10px;
  min-height: 1.4em;
}
.avoid-badge.is-empty {
  color: transparent;
  border-top-color: transparent;
}
.avoid-badge.unavoidable { color: var(--vermilion); }

/* ---------- Homepage goods showcase (pop gallery) ---------- */

.goods-showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

@media (max-width: 780px) {
  .goods-showcase { grid-template-columns: repeat(2, 1fr); }
}

.showcase-card {
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.showcase-card:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.showcase-card img {
  width: 100%;
  aspect-ratio: 0.6756;
  object-fit: cover;
  background: #fff;
  display: block;
  border-bottom: 3px solid var(--ink);
}

.showcase-card .label {
  padding: 10px 12px;
  font-weight: 900;
  font-size: 0.92rem;
  text-align: center;
}

/* ---------- Decorative patterns ---------- */

.pattern-cargo {
  position: relative;
  overflow: hidden;
}

.pattern-cargo::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='160' viewBox='0 0 220 160'%3E%3Cg fill='%23F2E8CF'%3E%3Crect x='10' y='20' width='26' height='20' rx='2'/%3E%3Crect x='42' y='20' width='26' height='20' rx='2'/%3E%3Ccircle cx='120' cy='30' r='11'/%3E%3Cpath d='M150 45 L172 45 L178 30 L188 30 L188 45 L192 45 L192 55 L150 55 Z'/%3E%3Crect x='30' y='100' width='16' height='16' rx='3' transform='rotate(15 38 108)'/%3E%3Ccircle cx='100' cy='110' r='3'/%3E%3Ccircle cx='112' cy='118' r='3'/%3E%3Ccircle cx='100' cy='126' r='3'/%3E%3Crect x='95' y='105' width='24' height='24' rx='4' fill='none' stroke='%23F2E8CF' stroke-width='2'/%3E%3Cpath d='M170 100 L190 100 L190 110 L182 118 L170 118 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 160px;
}

.pattern-cargo > * { position: relative; z-index: 1; }

.wave-divider {
  display: block;
  width: 100%;
  height: 40px;
  line-height: 0;
}

.wave-divider svg { width: 100%; height: 100%; display: block; }

/* ---------- Floating decorative icons ---------- */

.floaty-icons {
  position: relative;
  overflow: visible;
}

.floaty-icons .floaty {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.9;
  animation: floaty-bob 4s ease-in-out infinite;
  pointer-events: none;
}

.floaty-icons .floaty:nth-child(2) { animation-delay: 0.8s; }
.floaty-icons .floaty:nth-child(3) { animation-delay: 1.6s; }
.floaty-icons .floaty:nth-child(4) { animation-delay: 2.4s; }

@keyframes floaty-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

/* ---------- Board map (real illustration) ---------- */

.wrap-wide {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 16px;
}

.board-map-frame {
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
}
.board-map-frame img { width: 100%; display: block; }

.flow-steps {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-top: 32px;
  flex-wrap: wrap;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 200px;
  padding: 18px 12px;
}
.flow-step .flow-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}
.flow-step .flow-icon svg { width: 100%; height: 100%; }
.flow-step .flow-label {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 4px;
}
.flow-step .flow-sub {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 1.8rem;
  padding: 0 8px;
}
@media (max-width: 720px) {
  .flow-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* ---------- Game overview (box-inspired panels) ---------- */

.overview-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 780px) { .overview-panels { grid-template-columns: 1fr; } }

.overview-panel {
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--paper-light);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.overview-panel .panel-head {
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 12px 20px;
  border-bottom: 3px solid var(--ink);
}
.overview-panel.alt .panel-head { background: var(--teal); }
.overview-panel .panel-body {
  padding: 22px 24px;
}
.overview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.overview-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.overview-list .ov-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.overview-list .ov-icon svg { width: 100%; height: 100%; }
.overview-list .ov-text { color: var(--ink); line-height: 1.7; padding-top: 4px; }
.overview-list .ov-text strong { color: var(--blue); }

.learn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.learn-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  font-weight: 700;
  font-size: 0.88rem;
}
.learn-chip .chip-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: var(--paper-light);
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}
.learn-chip .chip-icon svg { width: 100%; height: 100%; }

.overview-lead {
  position: relative;
}
.overview-lead-icon {
  position: absolute;
  top: -14px;
  right: 18px;
  width: 52px;
  height: 52px;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(8deg);
}
.overview-lead-icon svg { width: 30px; height: 30px; }
@media (max-width: 600px) { .overview-lead-icon { display: none; } }
.overview-panel p { margin: 0; color: var(--ink); line-height: 1.9; }
.overview-panel p strong { color: var(--teal); }

.overview-lead {
  grid-column: 1 / -1;
  color: var(--ink);
  line-height: 1.9;
  background: var(--paper);
  border-radius: var(--radius-m);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.overview-lead mark {
  background: #FFF1A8;
  padding: 0 3px;
}

/* ---------- Contents (card backs) ---------- */

.contents-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 780px) { .contents-cards { grid-template-columns: repeat(2, 1fr); } }

.content-card {
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--paper-light);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.content-card img { width: 100%; aspect-ratio: 0.6756; object-fit: cover; display: block; border-bottom: 3px solid var(--ink); }
.content-card .qty { padding: 10px 6px; font-weight: 900; font-size: 0.92rem; }

.contents-extra {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.contents-extra .extra-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-light);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.9rem;
}
.contents-extra .extra-item .icon { width: 22px; height: 22px; flex-shrink: 0; }
.contents-extra .extra-item .icon svg { width: 100%; height: 100%; }

/* ---------- Rules page: visual info chips ---------- */

.info-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.info-chip {
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  padding: 14px 10px;
  text-align: center;
  background: var(--paper-light);
}
.info-chip .chip-swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  margin: 0 auto 8px;
}
.info-chip .chip-label {
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 4px;
  line-height: 1.3;
}
.info-chip .chip-count {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--vermilion);
}

.goods-need-intro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper-light);
  font-weight: 900;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.need-group { margin-top: 22px; }
.need-groups-row {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.need-groups-row .need-group { margin-top: 0; }
.need-groups-row.cols-2 { grid-template-columns: 1fr 1fr; }
.need-groups-row.cols-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 680px) {
  .need-groups-row.cols-2,
  .need-groups-row.cols-3 { grid-template-columns: 1fr; }
}
.need-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 10px;
}
.need-group-head .need-badge {
  background: var(--vermilion);
  color: #fff;
  font-family: var(--font-mono);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.need-group-head .origin-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.need-group-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.need-group-cards .or-sep {
  display: flex;
  align-items: center;
  font-weight: 900;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.goods-need-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.goods-need-chip {
  text-align: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--paper-light);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease;
  width: 140px;
}
.goods-need-chip:hover { transform: translateY(-3px); }
.goods-need-chip img {
  width: 100%;
  aspect-ratio: 0.6756;
  object-fit: cover;
  display: block;
  border-bottom: 3px solid var(--ink);
}
.goods-need-chip .chip-info { padding: 10px 6px 12px; }
.goods-need-chip .chip-label {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}
.goods-need-chip .chip-count {
  font-family: var(--font-mono);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}
.goods-need-chip .chip-count .market-n { color: var(--vermilion); font-weight: 700; }

/* ---------- Choice grid (5-way goods selection) ---------- */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.choice-box {
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--paper-light);
  box-shadow: var(--shadow-card);
  padding: 18px 16px 16px;
  position: relative;
}
.choice-box .choice-num {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--vermilion);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-family: var(--font-mono);
  border: 3px solid var(--ink);
  font-size: 0.95rem;
}
.choice-box .choice-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 2px;
}
.choice-box .choice-head .need-badge {
  background: var(--vermilion);
  color: #fff;
  font-family: var(--font-mono);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.choice-box .choice-note {
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.choice-box .choice-imgs {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.choice-thumb { flex: 1; min-width: 0; text-align: center; }
.choice-thumb img {
  width: 100%;
  aspect-ratio: 0.6756;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
}
.choice-thumb .t-label { font-size: 0.78rem; font-weight: 700; line-height: 1.3; }
.choice-thumb .t-market { font-family: var(--font-mono); font-size: 0.7rem; color: var(--vermilion); }

.dice-roll-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dice-roll-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border-radius: var(--radius-m);
  padding: 12px 16px;
}
.dice-roll-list .dice-faces {
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: var(--ink);
  flex-shrink: 0;
  min-width: 70px;
}
.dice-roll-list .dice-desc { color: var(--ink); line-height: 1.6; }


/* ---------- Hero board backdrop ---------- */

.hero-board-backdrop {
  position: absolute;
  z-index: 0;
  opacity: 0.95;
  pointer-events: none;
  top: 8%;
  left: 50%;
  width: 92%;
  transform: translateX(-50%) rotate(-3deg);
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: 6px 8px 0 rgba(0,0,0,0.18);
}
.hero-board-backdrop img { width: 100%; display: block; }
.hero .wrap { position: relative; z-index: 1; }

.tab-btn .tab-icon { margin-right: 6px; }

/* ---------- Card detail modal (Culdcept-style click-to-enlarge) ---------- */

.card-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22,35,63,0.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card-modal-overlay.open { display: flex; }

.card-modal {
  background: var(--paper-light);
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.card-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-light);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-modal .modal-img-wrap {
  width: 100%;
  aspect-ratio: 0.6756;
  max-height: 60vh;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  position: relative;
  background: #fff;
}
.card-modal .modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-modal .modal-img-wrap .flag-badge { position: absolute; top: 14px; right: 14px; font-size: 2rem; background: var(--paper-light); border: 2px solid var(--ink); border-radius: 50%; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }

.card-modal .modal-body { padding: 26px 28px 30px; }
.card-modal .modal-body h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.card-modal .modal-body .no { font-family: var(--font-mono); color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 10px; }
.card-modal .modal-body .effect { font-size: 1rem; line-height: 1.8; color: var(--ink); margin-bottom: 16px; }
.card-modal .modal-body .price-row { display: flex; gap: 10px; margin-bottom: 16px; }
.card-modal .modal-body .price-box { flex: 1; background: var(--paper); border-radius: var(--radius-s); padding: 12px; text-align: center; }
.card-modal .modal-body .price-box .k { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }
.card-modal .modal-body .price-box .v { font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem; }
.card-modal .modal-body .price-box.sell .v { color: var(--vermilion); }

.card-modal .modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 1001;
}
.card-modal-overlay .modal-nav.prev { left: -60px; }
.card-modal-overlay .modal-nav.next { right: -60px; }
@media (max-width: 720px) {
  .card-modal-overlay .modal-nav.prev { left: 4px; }
  .card-modal-overlay .modal-nav.next { right: 4px; }
}

.game-card { cursor: pointer; }

/* ---------- Hero key visual (fanned real cards) ---------- */

.hero-keyart {
  position: relative;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-keyart .fan-card {
  position: absolute;
  width: 150px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 6px 8px 0 rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
}
.hero-keyart .fan-card img { width: 100%; display: block; }
.hero-keyart .fan-card:hover { transform: translateY(-14px) scale(1.04) !important; z-index: 10; }
.hero-keyart .fan-card.f1 { transform: rotate(-22deg) translate(-120px, 10px); z-index: 1; }
.hero-keyart .fan-card.f2 { transform: rotate(-11deg) translate(-65px, -10px); z-index: 2; }
.hero-keyart .fan-card.f3 { transform: rotate(0deg) translate(0, -20px); z-index: 3; }
.hero-keyart .fan-card.f4 { transform: rotate(11deg) translate(65px, -10px); z-index: 2; }
.hero-keyart .fan-card.f5 { transform: rotate(22deg) translate(120px, 10px); z-index: 1; }
@media (max-width: 860px) {
  .hero-keyart { height: 320px; }
  .hero-keyart .fan-card { width: 100px; }
  .hero-keyart .fan-card.f1 { transform: rotate(-22deg) translate(-80px, 6px); }
  .hero-keyart .fan-card.f2 { transform: rotate(-11deg) translate(-42px, -6px); }
  .hero-keyart .fan-card.f4 { transform: rotate(11deg) translate(42px, -6px); }
  .hero-keyart .fan-card.f5 { transform: rotate(22deg) translate(80px, 6px); }
}

.hero-keyart-extra {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}
.hero-keyart-extra svg { width: 100%; height: 100%; }
.hero-keyart-extra.e1 { top: -6%; left: -2%; width: 42px; transform: rotate(-10deg); }
.hero-keyart-extra.e2 { top: 4%; right: -4%; width: 36px; transform: rotate(14deg); }
.hero-keyart-extra.e3 { bottom: -4%; left: 6%; width: 38px; transform: rotate(18deg); }
.hero-keyart-extra.e4 { bottom: 2%; right: 2%; width: 44px; transform: rotate(-14deg); }
@media (max-width: 860px) {
  .hero-keyart-extra { display: none; }
}

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 40px 0;
  margin-top: 40px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .foot-links { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; }
.site-footer a { opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer .copy { font-family: var(--font-mono); font-size: 0.8rem; opacity: 0.6; }

/* ---------- Generic content page styles (rules / faq / contact) ---------- */

.page-hero {
  background: var(--ink);
  color: var(--paper-light);
  padding: 56px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--paper-light) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.05;
  pointer-events: none;
}
.page-hero-doodle {
  position: absolute;
  opacity: 0.85;
  pointer-events: none;
}
.page-hero-doodle svg { width: 100%; height: 100%; }
.page-hero-doodle.p1 { top: 12%; left: 4%; width: 38px; transform: rotate(-14deg); }
.page-hero-doodle.p2 { bottom: 10%; right: 5%; width: 34px; transform: rotate(12deg); }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 10px;
}
.page-hero p { color: var(--paper); opacity: 0.85; margin: 0; }

.content-block {
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.content-block h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-block h2 .step-no {
  font-family: var(--font-mono);
  background: var(--vermilion);
  color: var(--paper-light);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.content-block h2 .h2-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.content-block h2 .h2-icon svg { width: 100%; height: 100%; }

.page-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
}
.page-hero-icon svg { width: 100%; height: 100%; }

.faq-item { border-bottom: 1px solid rgba(22,35,63,0.12); padding: 18px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item .q {
  font-weight: 900;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item .q::before { content: 'Q.'; color: var(--vermilion); margin-right: 8px; font-family: var(--font-mono); }
.faq-item .a { color: var(--ink-soft); margin-top: 10px; display: none; }
.faq-item .a::before { content: 'A.'; color: var(--teal); font-weight: 900; margin-right: 6px; font-family: var(--font-mono); }
.faq-item.open .a { display: block; }
.faq-item .toggle { font-family: var(--font-mono); flex-shrink: 0; }
