/* =========================================================
   マジクラプロジェクト — main stylesheet (v2.0 メルヘン × ドット絵)
   Imported from style.css via enqueue.
   ※ v1.9 までのクラス名・DOM 構造はすべて維持しています。
   ========================================================= */

:root {
    --mj-pink:        #f2729b;
    --mj-pink-soft:   #ffe4ef;
    --mj-purple:      #a488d8;
    --mj-purple-soft: #eae2fb;
    --mj-blue:        #7fc3e8;
    --mj-blue-soft:   #ddf1fc;
    --mj-yellow:      #f5c84c;
    --mj-yellow-soft: #fff2c9;
    --mj-green:       #8fce9e;
    --mj-green-soft:  #e0f4e4;
    --mj-text:        #5c4a3f;
    --mj-text-soft:   #93806f;
    --mj-ink:         #4a3630;
    --mj-cream:       #fdf3df;
    --mj-white:       #fffdf8;
    --mj-outline:     #4a3630;
    --mj-shadow:      6px 6px 0 rgba(74, 54, 48, 0.13);
    --mj-radius:      14px;
    --mj-radius-lg:   20px;
    --mj-font-pixel:  'DotGothic16', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
    --mj-font-body:   'M PLUS Rounded 1c', 'Quicksand', 'Hiragino Maru Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--mj-font-body);
    color: var(--mj-text);
    background-color: var(--mj-cream);
    background-image: radial-gradient(rgba(74, 54, 48, 0.08) 1.5px, transparent 1.6px);
    background-size: 20px 20px;
    min-height: 100vh;
    line-height: 1.7;
}

a { color: var(--mj-pink); text-decoration: none; }
a:hover { text-decoration: underline dotted; text-underline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); }

/* ---------- Skip link / container ---------- */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--mj-pink); color: #fff; padding: 8px 14px; z-index: 9999; }
.skip-link:focus { top: 0; }
.site-main { min-height: 60vh; display: block; }

/* ---------- Header ---------- */
.site-header {
    position: relative;
    padding: 14px 32px;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 3px solid var(--mj-outline);
    box-shadow: 0 4px 0 rgba(74, 54, 48, 0.08);
    z-index: 50;
}
.site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}
.site-header__default-logo img {
    max-height: 70px;
    width: auto;
}

.primary-nav__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
}
.primary-nav__item a {
    display: inline-block;
    padding: 10px 6px;
    font-family: var(--mj-font-pixel);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--mj-text);
    text-transform: uppercase;
    font-size: 15px;
    position: relative;
    text-decoration: none;
}
.primary-nav__item.is-active a {
    color: var(--mj-pink);
}
.primary-nav__item.is-active a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 4px; border-radius: 2px;
    background: var(--mj-pink);
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.18);
}
.primary-nav__item a:hover { color: var(--mj-purple); text-decoration: none; }

.site-header__icons { display: flex; gap: 10px; align-items: center; }
.icon-btn {
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.35);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.35); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 64px 32px 60px;
    background-size: cover;
    background-position: center;
    background-color: #bfe3f7;
    border-bottom: 3px solid var(--mj-outline);
}
/* 雲のようなスクロップ縁（メルヘン仕上げ） */
.hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 22px;
    background-image: radial-gradient(circle at 16px 0px, var(--mj-cream) 15px, rgba(253, 243, 223, 0) 16px);
    background-size: 32px 22px;
    background-repeat: repeat-x;
    z-index: 3;
    pointer-events: none;
}
.hero__inner { max-width: 1280px; margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.hero__decor { position: absolute; z-index: 1; pointer-events: none; }
.hero__decor img { display: block; image-rendering: pixelated; animation: mj-float 4.2s ease-in-out infinite; }
@keyframes mj-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}
.hero__decor--wand-l { left: -40px; top: 30px; width: 210px; transform: rotate(-12deg); }
.hero__decor--wand-l img { filter: drop-shadow(4px 6px 0 rgba(74, 54, 48, 0.22)); }
.hero__decor--castle-r { right: -10px; top: 10px; width: 270px; }
.hero__decor--potion-a { left: 12%; top: 58%; width: 104px; transform: rotate(-8deg); }
.hero__decor--potion-b { right: 16%; top: 62%; width: 122px; transform: rotate(7deg); }

/* ---------- Page title ---------- */
.page-title {
    display: inline-flex; align-items: center; gap: 18px;
}
.page-title__main {
    display: inline-block;
    margin: 0;
    font-family: var(--mj-font-pixel);
    font-size: clamp(44px, 7vw, 78px);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--mj-white);
    text-shadow:
       3px  0 0 var(--mj-outline),
      -3px  0 0 var(--mj-outline),
       0  3px 0 var(--mj-outline),
       0 -3px 0 var(--mj-outline),
       2px  2px 0 var(--mj-outline),
      -2px  2px 0 var(--mj-outline),
       2px -2px 0 var(--mj-outline),
      -2px -2px 0 var(--mj-outline),
       6px  6px 0 rgba(74, 54, 48, 0.35);
}
.page-title__deco {
    color: var(--mj-yellow);
    font-size: 0.7em;
    text-shadow: 2px 2px 0 var(--mj-outline);
}
.page-subtitle {
    margin: 14px 0 0;
    font-family: var(--mj-font-pixel);
    letter-spacing: 0.16em;
    color: var(--mj-white);
    text-shadow: 1px 1px 0 var(--mj-outline), 2px 2px 0 rgba(74, 54, 48, 0.4);
    font-weight: 400;
}

/* ---------- Character board ---------- */
.character-board { padding: 26px 32px 80px; }
.character-board__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: stretch;
}

.char-rail {
    position: relative;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius-lg);
    padding: 16px 12px;
    box-shadow: var(--mj-shadow);
}
.char-rail__rail {
    position: absolute;
    left: 18px; top: 16px; bottom: 16px;
    width: 4px;
    border-radius: 4px;
    background: repeating-linear-gradient(180deg, var(--mj-pink) 0 10px, rgba(0,0,0,0) 10px 18px);
}
.char-rail__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.char-rail__btn {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 8px 8px 26px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--mj-text);
    transition: background 0.15s ease, transform 0.12s steps(2, end);
}
.char-rail__btn:hover { background: var(--mj-pink-soft); transform: translateX(3px); text-decoration: none; }
.char-rail__item.is-active .char-rail__btn { background: var(--mj-yellow-soft); box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.18); }
.char-rail__thumb {
    position: relative;
    width: 56px; height: 56px;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    background: var(--mj-pink-soft);
    border: 3px solid var(--mj-outline);
    box-shadow: inset 0 0 0 3px var(--mj-white);
}
.char-rail__thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.char-rail__thumb.color-mei  { background: #ffe9c7; }
.char-rail__thumb.color-sora { background: #d9efff; }
.char-rail__thumb.color-luna { background: #eae1fb; }
.char-rail__thumb.color-rin  { background: #ffdbdb; }
.char-rail__thumb.color-hana { background: #e0f4e4; }
.char-rail__indicator {
    position: absolute;
    right: 3px; top: 3px;
    width: 12px; height: 12px;
    border: 2px solid var(--mj-outline);
    background: var(--mj-pink);
}
.char-rail__item.is-active .char-rail__indicator { background: var(--mj-yellow); }
.char-rail__name { font-weight: 700; font-size: 14px; }

/* Character detail card */
.char-detail { position: relative; }
.char-detail__frame {
    position: relative;
    border-radius: var(--mj-radius-lg);
    padding: 20px;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    box-shadow: var(--mj-shadow);
    overflow: visible;
}
.char-detail__frame::before, .char-detail__frame::after {
    content: '✦';
    position: absolute;
    color: var(--mj-yellow);
    font-size: 26px;
    text-shadow: 2px 2px 0 var(--mj-outline);
}
.char-detail__frame::before { left: 14px;  top: 14px; }
.char-detail__frame::after  { right: 14px; bottom: 14px; }

.char-detail__main {
    display: grid; place-items: center;
    margin-bottom: 16px;
}
.char-detail__img {
    max-height: 420px;
    width: auto;
    image-rendering: pixelated;
    filter: drop-shadow(5px 6px 0 rgba(74, 54, 48, 0.18));
}
.char-detail__title {
    text-align: center;
    margin: 6px 0 18px;
    font-family: var(--mj-font-pixel);
    font-size: clamp(20px, 2.4vw, 27px);
    font-weight: 400;
    color: var(--mj-purple);
    letter-spacing: 0.06em;
}
.char-detail__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.15);
}
.stat__label { font-family: var(--mj-font-pixel); color: var(--mj-pink); letter-spacing: 0.08em; }
.stat__value { font-weight: 700; color: var(--mj-text); }
.stat__bar {
    height: 10px;
    border: 2px solid var(--mj-outline);
    border-radius: 6px;
    background: var(--mj-white);
    overflow: hidden;
}
.stat__fill { height: 100%; }
.stat--hp .stat__fill { background: repeating-linear-gradient(90deg, var(--mj-pink) 0 8px, var(--mj-purple) 8px 16px); }
.stat--mp .stat__fill { background: repeating-linear-gradient(90deg, var(--mj-blue) 0 8px, var(--mj-purple) 8px 16px); }

.char-detail__skills {
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 16px;
}
.skills-tag {
    background: var(--mj-purple);
    color: var(--mj-white);
    border: 2px solid var(--mj-outline);
    border-radius: 10px;
    padding: 5px 13px;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.1em;
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.35);
}
.skills-text { color: var(--mj-text); font-weight: 600; }

.char-detail__bio {
    background: var(--mj-yellow-soft);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--mj-text);
    margin: 0 0 18px;
}

.char-detail__actions {
    display: flex; justify-content: center; gap: 18px;
    margin-top: 18px;
}
.btn {
    display: inline-block;
    min-width: 170px;
    padding: 13px 30px;
    text-align: center;
    font-family: var(--mj-font-pixel);
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.14em;
    color: var(--mj-white);
    background: var(--mj-pink);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    box-shadow: 4px 4px 0 var(--mj-outline);
    text-shadow: 1px 1px 0 rgba(74, 54, 48, 0.4);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
    text-decoration: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--mj-outline); text-decoration: none; }
.btn--voice   { background: var(--mj-pink); }
.btn--gallery { background: var(--mj-purple); }
.btn--home    { background: var(--mj-blue); margin-top: 16px; }

/* ---------- Link board ---------- */
.link-board { padding: 20px 32px 80px; }
.link-board__inner { max-width: 1100px; margin: 0 auto; }
.link-grid {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.link-card {
    --card-color: var(--mj-purple);
}
.link-card__inner {
    display: grid;
    grid-template-rows: 84px auto auto 42px;
    align-items: center;
    justify-items: center;
    text-align: center;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius);
    padding: 22px 20px 18px;
    box-shadow: var(--mj-shadow);
    color: var(--mj-text);
    position: relative;
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
    height: 100%;
    text-decoration: none;
}
.link-card__inner::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 10px;
    border: 2px dashed var(--card-color);
    pointer-events: none;
}
.link-card__inner:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(74, 54, 48, 0.18); text-decoration: none; }
.link-card__icon img {
    width: 72px; height: 72px;
    object-fit: contain;
    image-rendering: pixelated;
}
.link-card__title { font-family: var(--mj-font-pixel); font-weight: 400; line-height: 1.4; }
.link-card__title-jp { display: block; font-size: 16px; }
.link-card__title-en { display: block; font-size: 12px; color: var(--mj-text-soft); letter-spacing: 0.06em; }
.link-card__desc { color: var(--mj-text-soft); font-size: 13px; line-height: 1.55; padding: 0 6px; }
.link-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 22px;
    border-radius: 10px;
    font-family: var(--mj-font-pixel);
    letter-spacing: 0.12em;
    font-size: 13px;
    color: var(--mj-white);
    background: var(--card-color);
    border: 2px solid var(--mj-outline);
    box-shadow: 3px 3px 0 var(--mj-outline);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.link-card__inner:hover .link-card__cta { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--mj-outline); }

/* ---------- Generic page content ---------- */
.page-content, .single-content, .archive-content { padding: 20px 32px 80px; }
.page-content__inner, .single-content__inner, .archive-content__inner {
    max-width: 900px; margin: 0 auto;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius);
    padding: 32px;
    box-shadow: var(--mj-shadow);
}
.entry-content p { line-height: 1.9; }
.entry-thumb { border: 3px solid var(--mj-outline); border-radius: 12px; margin-bottom: 18px; }
.entry-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--mj-text-soft);
}
.entry-meta time {
    font-family: var(--mj-font-pixel);
    background: var(--mj-pink-soft);
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    padding: 3px 10px;
    color: var(--mj-pink);
}
.page-links { margin-top: 18px; font-family: var(--mj-font-pixel); }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.post-list__item a {
    display: grid; grid-template-columns: 120px 1fr; gap: 16px;
    color: var(--mj-text); padding: 12px; border-radius: 12px;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.12);
    text-decoration: none;
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.post-list__item a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(74, 54, 48, 0.16); text-decoration: none; }
.post-list__title { font-weight: 800; }
.post-list__excerpt { color: var(--mj-text-soft); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    background-size: cover;
    background-position: center;
    color: var(--mj-white);
    padding: 56px 32px 36px;
    margin-top: 24px;
    border-top: 3px solid var(--mj-outline);
}
.site-footer::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(42, 30, 74, 0.38), rgba(20, 12, 44, 0.78));
    z-index: 0;
}
/* フッター上部の雲スクロップ */
.site-footer::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: -24px;
    height: 24px;
    background-image: radial-gradient(circle at 16px 24px, var(--mj-cream) 15px, rgba(253, 243, 223, 0) 16px);
    background-size: 32px 24px;
    background-repeat: repeat-x;
    z-index: 2;
    pointer-events: none;
}
.site-footer__inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; text-align: center; }
.site-footer__brand img { width: 110px; height: auto; margin: 0 auto 10px; border-radius: 18px; border: 3px solid rgba(255, 253, 248, 0.9); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25); }
.footer-nav__list { display: flex; gap: 18px; list-style: none; padding: 0; justify-content: center; flex-wrap: wrap; }
.footer-nav__list a {
    color: var(--mj-white);
    font-family: var(--mj-font-pixel);
    letter-spacing: 0.08em;
    text-decoration: none;
}
.footer-nav__list a:hover { color: var(--mj-yellow); }
.site-footer__copy { letter-spacing: 0.12em; font-size: 12px; opacity: 0.9; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .character-board__inner { grid-template-columns: 1fr; }
    .char-rail__rail { display: none; }
    .char-rail__list { flex-direction: row; overflow-x: auto; padding-left: 0; }
    .char-rail__btn { padding-left: 8px; }
    .link-grid { grid-template-columns: repeat(2, 1fr); }
    .site-header__inner { grid-template-columns: auto auto; }
    .primary-nav { order: 3; grid-column: 1 / -1; }
    .header-panel { right: 140px; }
}
@media (max-width: 640px) {
    .link-grid { grid-template-columns: 1fr; }
    .site-header { padding: 14px 18px; }
    .hero__decor--wand-l, .hero__decor--castle-r { display: none; }
    .char-detail__stats { grid-template-columns: 1fr; }
    .header-panel { left: 14px; right: 14px; min-width: 0; }
}


/* =========================================================
   レスポンシブ対応 — smartphone / tablet
   ========================================================= */

/* --- Hamburger toggle (desktop: hidden) --- */
.nav-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    background: var(--mj-white);
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.35);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.nav-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.35); }
.nav-toggle__bar {
    display: block;
    width: 20px;
    height: 3px;
    margin: 3px auto;
    border-radius: 0;
    background: var(--mj-pink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Mobile (max-width: 820px) --- */
@media (max-width: 820px) {

    /* Header: logo(1fr) + icons + hamburger on one row; nav drops below */
    .site-header { padding: 12px 14px; }
    .site-header__inner { grid-template-columns: 1fr auto auto; gap: 10px; }
    .site-header__logo    { grid-column: 1; }
    .site-header__icons   { grid-column: 2; }
    .nav-toggle           { grid-column: 3; display: grid; }
    .site-header__default-logo img { max-height: 48px; }
    .icon-btn { width: 40px; height: 40px; }

    /* Nav becomes a dropdown panel when opened */
    .primary-nav {
        order: 4;
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        margin-top: 8px;
        padding: 10px;
        background: var(--mj-white);
        border: 3px solid var(--mj-outline);
        border-radius: 14px;
        box-shadow: 5px 5px 0 rgba(74, 54, 48, 0.18);
    }
    .primary-nav.is-open { display: block; }
    .primary-nav__list { flex-direction: column; gap: 4px; }
    .primary-nav__item a {
        display: block;
        padding: 13px 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    .primary-nav__item.is-active a {
        color: var(--mj-pink);
        background: var(--mj-pink-soft);
    }
    .primary-nav__item.is-active a::after { display: none; }
    .primary-nav__item a:hover { background: var(--mj-pink-soft); }

    /* Hero */
    .hero { padding: 44px 16px 40px; }
    .page-title__main { font-size: clamp(34px, 12vw, 58px); letter-spacing: 0.06em; }
    .hero__decor--wand-l   { left: -60px; width: 150px; }
    .hero__decor--castle-r { right: -40px; width: 190px; }

    /* Character board: detail first, selector becomes a horizontal scroller */
    .character-board { padding: 14px 14px 56px; }
    .character-board__inner { grid-template-columns: 1fr; gap: 18px; }
    .char-detail { order: 1; }
    .char-rail   { order: 2; padding: 12px 10px; }
    .char-rail__rail { display: none; }
    .char-rail__list {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        gap: 10px;
        padding-bottom: 4px;
    }
    .char-rail__item { flex: 0 0 auto; scroll-snap-align: start; }
    .char-rail__btn { grid-template-columns: 44px auto; gap: 10px; padding: 6px 10px; min-width: 148px; }
    .char-rail__thumb { width: 44px; height: 44px; }
    .char-rail__indicator { width: 10px; height: 10px; }
    .char-rail__name { font-size: 13px; }

    .char-detail__frame { padding: 14px; }
    .char-detail__img { max-height: 320px; }
    .char-detail__stats { grid-template-columns: 1fr; gap: 10px; }
    .char-detail__skills { flex-direction: column; gap: 6px; }
    .char-detail__actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .btn { min-width: 0; width: 100%; }

    /* Link board: single column */
    .link-board { padding: 10px 14px 56px; }
    .link-grid { grid-template-columns: 1fr; gap: 14px; }
    .link-card__inner { grid-template-rows: 72px auto auto 42px; padding: 16px 14px 14px; }
    .link-card__icon img { width: 58px; height: 58px; }

    /* Generic content */
    .page-content, .single-content, .archive-content { padding: 8px 14px 56px; }
    .page-content__inner, .single-content__inner, .archive-content__inner { padding: 20px; border-radius: 14px; }

    /* Footer */
    .site-footer { padding: 44px 16px 28px; }
    .site-footer__brand img { width: 92px; }
    .footer-nav__list { gap: 12px; font-size: 13px; }
}

/* --- Small phones (max-width: 380px) --- */
@media (max-width: 380px) {
    .hero__decor--potion-a, .hero__decor--potion-b { display: none; }
    .site-header__icons { gap: 6px; }
    .page-title__main { font-size: clamp(28px, 11vw, 40px); }
}

/* --- Accessibility: respect reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .link-card__inner, .icon-btn, .nav-toggle, .post-list__item a, .link-card__cta { transition: none; }
    .hero__decor img { animation: none; }
}


/* =========================================================
   キャラクター個別ページ (single-mj_character.php)
   ========================================================= */
.single-character { padding: 20px 32px 80px; }
.single-character__inner { max-width: 900px; margin: 0 auto; }

.char-detail--single .char-detail__img { max-height: 520px; margin: 0 auto; }
.char-detail--single .char-detail__bio {
    background: var(--mj-yellow-soft);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--mj-text);
    margin: 0 0 18px;
    font-size: 15px;
}

/* 前後キャラクターへのナビゲーション */
.single-character__nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 26px 0 8px;
}
.single-character__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.15);
    color: var(--mj-text);
    text-decoration: none;
    max-width: 46%;
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.single-character__nav-link:hover { transform: translate(-2px, -2px); text-decoration: none; }
.single-character__nav-link img {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--mj-outline);
    image-rendering: pixelated;
}
.single-character__nav-link--next { flex-direction: row-reverse; margin-left: auto; text-align: right; }
.single-character__nav-label {
    display: block;
    font-family: var(--mj-font-pixel);
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--mj-pink);
}
.single-character__nav-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--mj-text);
}
.single-character__back { text-align: center; margin-top: 18px; }

/* 404 用文字幅・フォントなどのフィックス */
@media (max-width: 640px) {
    .single-character { padding: 8px 14px 56px; }
    .single-character__nav { flex-direction: column; align-items: stretch; }
    .single-character__nav-link, .single-character__nav-link--next {
        max-width: 100%;
        margin-left: 0;
        text-align: left;
        flex-direction: row;
    }
    .char-detail--single .char-detail__img { max-height: 360px; }
}


/* =========================================================
   お問い合わせ (CONTACT) ページ — Formspree
   ========================================================= */
.contact-board { padding: 20px 32px 80px; }
.contact-board__inner { max-width: 760px; margin: 0 auto; }
.contact-card {
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius-lg);
    padding: 36px 40px;
    box-shadow: var(--mj-shadow);
    position: relative;
}
.contact-card::before, .contact-card::after {
    content: '✦';
    position: absolute;
    color: var(--mj-yellow);
    font-size: 24px;
    text-shadow: 2px 2px 0 var(--mj-outline);
}
.contact-card::before { left: 16px; top: 16px; }
.contact-card::after  { right: 16px; bottom: 16px; }
.contact-intro { text-align: center; color: var(--mj-text); margin: 0 0 26px; font-weight: 600; }
.contact-note { text-align: center; color: var(--mj-text-soft); font-size: 12px; margin: 16px 0 0; line-height: 1.7; }
.contact-note--warning {
    background: var(--mj-yellow-soft);
    border: 3px dashed var(--mj-outline);
    color: var(--mj-ink);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
}
.contact-form { display: grid; gap: 18px; margin-top: 22px; }
.contact-field label {
    display: block;
    font-family: var(--mj-font-pixel);
    color: var(--mj-purple);
    margin-bottom: 6px;
    font-size: 15px;
    letter-spacing: 0.06em;
}
.contact-req { color: var(--mj-pink); margin-left: 2px; }
.contact-field input,
.contact-field select,
.contact-field textarea {
    width: 100%;
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--mj-text);
    background: var(--mj-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: var(--mj-pink);
    box-shadow: 4px 4px 0 rgba(242, 114, 155, 0.35);
}
.contact-field textarea { resize: vertical; }
.contact-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.contact-field--submit { text-align: center; }
.contact-submit {
    display: inline-block;
    min-width: 220px;
    padding: 13px 36px;
    cursor: pointer;
    font-family: var(--mj-font-pixel);
    font-size: 16px;
    letter-spacing: 0.14em;
    color: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    background: var(--mj-pink);
    box-shadow: 4px 4px 0 var(--mj-outline);
    text-shadow: 1px 1px 0 rgba(74, 54, 48, 0.4);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.contact-submit:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--mj-outline); }
.contact-status {
    display: none;
    border-radius: 12px;
    border: 3px solid var(--mj-outline);
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.15);
}
.contact-status.is-visible { display: block; }
.contact-status--success { background: var(--mj-green-soft); color: #2e7d4f; }
.contact-status--error   { background: #ffe1e1; color: #b33232; }
@media (max-width: 640px) {
    .contact-board { padding: 8px 14px 56px; }
    .contact-card { padding: 24px 18px; }
}


/* =========================================================
   ヘッダー ドロップダウン（検索）
   ========================================================= */
.header-panel {
    position: absolute;
    top: 100%;
    right: 100px;
    z-index: 300;
    min-width: 320px;
    margin-top: 6px;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    box-shadow: 6px 6px 0 rgba(74, 54, 48, 0.18);
    padding: 16px;
}
.header-panel[hidden] { display: none; }

.header-search-form input[type="search"],
.header-search-form .search-field {
    width: 100%;
    border: 3px solid var(--mj-outline);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--mj-text);
    background: var(--mj-white);
}
.header-search-form input[type="search"]:focus,
.header-search-form .search-field:focus {
    outline: none;
    border-color: var(--mj-pink);
    box-shadow: 3px 3px 0 rgba(242, 114, 155, 0.35);
}
.header-search-form .search-submit {
    width: 100%;
    margin-top: 10px;
    padding: 10px 0;
    cursor: pointer;
    font-family: var(--mj-font-pixel);
    font-size: 15px;
    letter-spacing: 0.12em;
    color: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 10px;
    background: var(--mj-pink);
    box-shadow: 3px 3px 0 var(--mj-outline);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.header-search-form .search-submit:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--mj-outline); }


/* =========================================================
   トップページ（お知らせ + サイトマップ）
   ========================================================= */
.hero--home { padding: 76px 32px 64px; }
.hero__catch {
    display: inline-block;
    margin: 0 0 14px;
    font-family: var(--mj-font-pixel);
    font-size: 15px;
    letter-spacing: 0.16em;
    color: var(--mj-pink);
    background: var(--mj-white);
    border: 2px solid var(--mj-outline);
    border-radius: 10px;
    padding: 5px 16px;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.25);
}
.hero__brandname {
    margin: 0 0 12px;
    font-family: var(--mj-font-pixel);
    font-size: clamp(32px, 6vw, 54px);
    letter-spacing: 0.06em;
    color: var(--mj-white);
    text-shadow:
       3px  0 0 var(--mj-outline),
      -3px  0 0 var(--mj-outline),
       0  3px 0 var(--mj-outline),
       0 -3px 0 var(--mj-outline),
       2px  2px 0 var(--mj-outline),
      -2px  2px 0 var(--mj-outline),
       2px -2px 0 var(--mj-outline),
      -2px -2px 0 var(--mj-outline),
       6px  6px 0 rgba(74, 54, 48, 0.35);
}
.hero__tagline {
    margin: 0 0 24px;
    color: var(--mj-ink);
    font-weight: 700;
    background: rgba(255, 253, 248, 0.85);
    display: inline-block;
    border: 2px solid var(--mj-outline);
    border-radius: 12px;
    padding: 8px 20px;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.25);
}
.hero__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.section-head { text-align: center; margin: 0 0 26px; }
.section-head__title {
    margin: 0;
    font-family: var(--mj-font-pixel);
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: 0.1em;
    color: var(--mj-purple);
    text-shadow: 2px 2px 0 var(--mj-purple-soft), 4px 4px 0 rgba(74, 54, 48, 0.12);
}
.section-head__sub {
    display: block;
    margin-top: 6px;
    font-family: var(--mj-font-pixel);
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--mj-pink);
}

.home-news, .home-guide { padding: 24px 32px 70px; }
.home-news__inner, .home-guide__inner { max-width: 1100px; margin: 0 auto; }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-list__item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    align-items: baseline;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 4px 4px 0 rgba(74, 54, 48, 0.12);
}
.news-list__date {
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    color: var(--mj-pink);
    letter-spacing: 0.06em;
}
.news-list__title { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.news-list__title a { color: var(--mj-text); }
.news-list__title a:hover { color: var(--mj-pink); }
.news-list__excerpt { margin: 0; font-size: 13px; color: var(--mj-text-soft); }
.news-empty {
    text-align: center; color: var(--mj-text-soft);
    background: var(--mj-white);
    border: 3px dashed var(--mj-outline);
    border-radius: 14px;
    padding: 30px;
}

.guide-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.guide-card--hero { grid-column: span 2; }
.guide-card__inner {
    display: block;
    height: 100%;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius);
    padding: 22px 20px;
    box-shadow: var(--mj-shadow);
    color: var(--mj-text);
    position: relative;
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
    text-decoration: none;
}
.guide-card__inner::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 9px;
    border: 2px dashed var(--mj-pink-soft);
    pointer-events: none;
}
.guide-card__inner:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(74, 54, 48, 0.18); text-decoration: none; }
.guide-card__title {
    margin: 0 0 8px;
    font-family: var(--mj-font-pixel);
    font-size: 20px;
    letter-spacing: 0.08em;
    color: var(--mj-purple);
}
.guide-card__desc { margin: 0 0 12px; font-size: 13px; color: var(--mj-text-soft); }
.guide-card__more {
    display: inline-block;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--mj-pink);
}

/* =========================================================
   キャラクター カテゴリーフィルター（作品 / ポジション）
   ========================================================= */
.char-filter {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: var(--mj-shadow);
}
.char-filter__group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.char-filter__label {
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.14em;
    color: var(--mj-purple);
    min-width: 74px;
}
.char-filter__tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.char-filter__tab {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 10px;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    color: var(--mj-text);
    background: var(--mj-white);
    border: 2px solid var(--mj-outline);
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.2);
    transition: all 0.12s steps(2, end);
    text-decoration: none;
}
.char-filter__tab:hover { border-color: var(--mj-pink); color: var(--mj-pink); text-decoration: none; }
.char-filter__tab.is-active {
    background: var(--mj-pink);
    color: var(--mj-white);
    border-color: var(--mj-outline);
    text-shadow: 1px 1px 0 rgba(74, 54, 48, 0.4);
}
.char-none {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--mj-text-soft);
    background: var(--mj-white);
    border: 3px dashed var(--mj-outline);
    border-radius: 14px;
    padding: 40px;
}

/* =========================================================
   変身前 / 変身後 切り替え（single-mj_character）
   ========================================================= */
.char-transform { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.char-transform__tab {
    padding: 9px 26px;
    border-radius: 10px;
    font-family: var(--mj-font-pixel);
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--mj-text);
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.2);
    transition: all 0.12s steps(2, end);
}
.char-transform__tab:hover { border-color: var(--mj-pink); color: var(--mj-pink); }
.char-transform__tab.is-active {
    background: var(--mj-pink);
    border-color: var(--mj-outline);
    color: var(--mj-white);
    text-shadow: 1px 1px 0 rgba(74, 54, 48, 0.4);
}
.char-transform__panel { display: none; }
.char-transform__panel.is-active { display: block; }
.char-detail__attrs { text-align: center; margin: -8px 0 14px; }
.char-attr {
    display: inline-block;
    margin: 0 4px 4px;
    padding: 4px 14px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    background: var(--mj-purple-soft);
    color: var(--mj-purple);
    font-family: var(--mj-font-pixel);
    font-size: 13px;
}
.char-detail__title-sub { font-size: 0.72em; color: var(--mj-text-soft); font-weight: 400; }

@media (max-width: 900px) {
    .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .home-news, .home-guide { padding: 14px 14px 56px; }
    .guide-grid { grid-template-columns: 1fr; }
    .guide-card--hero { grid-column: auto; }
    .news-list__item { grid-template-columns: 1fr; gap: 6px; }
    .char-filter { padding: 12px 14px; }
    .char-filter__group { flex-direction: column; align-items: flex-start; }
}


/* =========================================================
   作品別アーカイブ (taxonomy-mj_work.php)
   ========================================================= */
.work-archive { padding: 16px 32px 80px; }
.work-archive__inner { max-width: 1100px; margin: 0 auto; }
.work-grid {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.work-card__inner {
    display: grid;
    justify-items: center;
    text-align: center;
    height: 100%;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius);
    padding: 22px 16px;
    box-shadow: var(--mj-shadow);
    color: var(--mj-text);
    position: relative;
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
    text-decoration: none;
}
.work-card__inner:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(74, 54, 48, 0.18); text-decoration: none; }
.work-card__thumb img {
    width: 96px; height: 96px;
    border-radius: 14px;
    object-fit: cover;
    border: 3px solid var(--mj-outline);
    box-shadow: inset 0 0 0 3px var(--mj-white);
    image-rendering: pixelated;
    margin-bottom: 12px;
}
.work-card__name { font-family: var(--mj-font-pixel); font-size: 16px; color: var(--mj-purple); }
.work-card__title { font-size: 12px; color: var(--mj-text-soft); margin-top: 2px; }
.work-card__more {
    display: inline-block;
    margin-top: 12px;
    padding: 7px 20px;
    border-radius: 10px;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--mj-white);
    background: var(--mj-pink);
    border: 2px solid var(--mj-outline);
    box-shadow: 3px 3px 0 var(--mj-outline);
}
@media (max-width: 960px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
    .work-archive { padding: 8px 14px 56px; }
    .work-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   変身前 / 変身後 クロスフェード＋スパークルアニメーション
   ========================================================= */
.char-transform__stage {
    position: relative;
    display: grid;
    place-items: center;
}
.char-transform__panel { display: none; }
.char-transform__panel.is-active { display: block; }

/* ポップアウト（旧パネル） */
.char-transform__panel.is-popout {
    animation: mj-popout 0.26s ease-in both;
}
/* ポップイン（新パネル: 変身っぽくふわっと浮かび上がる） */
.char-transform__panel.is-popin {
    animation: mj-popin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes mj-popout {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes mj-popin {
    0%   { opacity: 0; transform: scale(0.84) translateY(18px); filter: blur(3px) brightness(1.45); }
    60%  { opacity: 1; filter: blur(0) brightness(1.12); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0) brightness(1); }
}

/* 星のスパークル */
.char-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}
.cs {
    position: absolute;
    left: 50%;
    top: 50%;
    color: var(--mj-yellow);
    font-size: 20px;
    opacity: 0;
    text-shadow: 2px 2px 0 var(--mj-outline);
}
.is-sparkling .cs {
    animation: mj-spark 0.72s ease-out forwards;
    animation-delay: var(--d, 0s);
}
@keyframes mj-spark {
    0%   { opacity: 0; transform: translate(-50%, -50%) translate(0, 0) scale(0.3) rotate(0deg); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx, 40px), var(--dy, -40px)) scale(1.05) rotate(50deg); }
}

/* アクセシビリティ: アニメーション軽減設定では瞬時に切り替え */
@media (prefers-reduced-motion: reduce) {
    .char-transform__panel.is-popout,
    .char-transform__panel.is-popin {
        animation: none;
    }
    .cs { display: none; }
}


/* =========================================================
   キャラクターページ スマホ最適化
   ・キャラ選択レールを画面上部に固定（タップですぐ切替）
   ・絞り込みタブを横スクロール化
   ・詳細カードの余白・文字サイズを最適化
   ========================================================= */
@media (max-width: 820px) {
    .hero--character { padding: 36px 14px 30px; }
    .character-board { padding: 4px 12px 56px; }
    .character-board__inner { gap: 16px; }

    /* レールを先頭に置き、上部へ追従させる */
    .char-rail {
        order: 1;
        position: sticky;
        top: 6px;
        z-index: 30;
        padding: 10px 8px;
        border-radius: 14px;
    }
    .char-detail { order: 2; }

    .char-rail__list {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 8px;
        padding: 2px 2px 6px;
    }
    .char-rail__item { flex: 0 0 auto; scroll-snap-align: center; }
    .char-rail__btn {
        grid-template-columns: 44px auto;
        gap: 8px;
        padding: 6px 12px;
        min-width: 140px;
    }
    .char-rail__thumb { width: 44px; height: 44px; }
    .char-rail__name { font-size: 12.5px; }

    /* 絞り込みタブは折り返さず横スクロール */
    .char-filter { padding: 12px; gap: 10px; border-radius: 14px; }
    .char-filter__group { flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; }
    .char-filter__label { min-width: 0; }
    .char-filter__tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding-bottom: 4px;
    }
    .char-filter__tab { flex: 0 0 auto; }

    /* 詳細カード */
    .char-detail__frame { padding: 16px 14px; border-radius: 16px; }
    .char-detail__frame::before, .char-detail__frame::after { font-size: 18px; }
    .char-detail__main { margin-bottom: 12px; }
    .char-detail__img { max-height: 300px; width: 100%; object-fit: contain; }
    .char-detail__title { font-size: 18px; line-height: 1.5; }
    .char-detail__stats { grid-template-columns: 1fr; gap: 10px; }
    .char-detail__skills { flex-direction: column; gap: 6px; }
    .char-detail__bio { font-size: 14px; padding: 14px; }
    .skills-text { font-size: 14px; }
    .char-detail__actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .char-detail__actions .btn { width: 100%; }
    .char-detail__attrs { margin: -4px 0 12px; }
}

@media (max-width: 480px) {
    .char-rail__btn { min-width: 124px; grid-template-columns: 40px auto; padding: 6px 10px; }
    .char-rail__thumb { width: 40px; height: 40px; }
    .char-rail__name { font-size: 12px; }
    .char-detail__img { max-height: 260px; }
    .char-detail__frame::before, .char-detail__frame::after { display: none; }
}


/* =========================================================
   ゲームページ (page-game.php) — 公開中 / 開発中
   ========================================================= */
.game-board { padding: 8px 32px 80px; }
.game-board__inner { max-width: 1180px; margin: 0 auto; }

.game-section { margin-bottom: 48px; }
.game-section__head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 4px dotted rgba(74, 54, 48, 0.3);
}
.game-section__title { margin: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.game-section__title-en {
    font-family: var(--mj-font-pixel);
    font-size: clamp(24px, 3.4vw, 32px);
    letter-spacing: 0.06em;
}
.game-section--released   .game-section__title-en { color: var(--mj-pink); }
.game-section--developing .game-section__title-en { color: var(--mj-purple); }
.game-section__title-jp {
    font-family: var(--mj-font-pixel);
    font-size: 14px;
    letter-spacing: 0.14em;
    color: var(--mj-text-soft);
}
.game-section__count {
    margin-left: auto;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--mj-white);
    padding: 5px 14px;
    border: 2px solid var(--mj-outline);
    border-radius: 10px;
    background: var(--mj-pink);
    box-shadow: 2px 2px 0 var(--mj-outline);
    white-space: nowrap;
}

.game-grid {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.game-card { --game-color: var(--mj-pink); }
.game-card__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--mj-white);
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius);
    box-shadow: var(--mj-shadow);
    color: var(--mj-text);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
    text-decoration: none;
}
.game-card__inner:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(74, 54, 48, 0.18); text-decoration: none; }

.game-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 3px solid var(--mj-outline);
    border-radius: calc(var(--mj-radius) - 3px) calc(var(--mj-radius) - 3px) 0 0;
    background: var(--mj-purple-soft);
}
.game-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.game-card__badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 14px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    font-family: var(--mj-font-pixel);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--mj-white);
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.4);
}
.game-card--released   .game-card__badge { background: var(--mj-pink); }
.game-card--developing .game-card__badge { background: var(--mj-purple); }
.game-card__demo {
    position: absolute;
    top: 10px; right: 10px;
    padding: 3px 12px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    font-family: var(--mj-font-pixel);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--mj-text);
    background: var(--mj-white);
}

.game-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 0;
    flex: 1;
}
.game-card__title { font-family: var(--mj-font-pixel); font-size: 17px; color: var(--mj-purple); line-height: 1.5; }
.game-card__title-en { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--mj-text-soft); }
.game-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game-tag {
    display: inline-block;
    font-family: var(--mj-font-pixel);
    font-size: 12px;
    padding: 3px 10px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    background: var(--mj-purple-soft);
    color: var(--mj-purple);
}
.game-tag--platform { background: var(--mj-blue-soft); color: #2b6ca3; }
.game-tag--players  { background: var(--mj-pink-soft); color: #c32d63; }
.game-tag--price    { background: var(--mj-yellow-soft); color: #8a6a00; }
.game-tag--date     { background: var(--mj-green-soft); color: #2e7d4f; }
.game-card__desc { font-size: 13px; line-height: 1.7; color: var(--mj-text-soft); }
.game-card__note {
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    color: var(--mj-purple);
    background: var(--mj-purple-soft);
    border: 2px dashed var(--mj-purple);
    border-radius: 10px;
    padding: 8px 10px;
}

.game-progress { display: block; margin-top: 4px; }
.game-progress__label {
    display: flex;
    justify-content: space-between;
    font-family: var(--mj-font-pixel);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--mj-text-soft);
    margin-bottom: 5px;
}
.game-progress__pct { color: var(--mj-purple); }
.game-progress__bar {
    display: block;
    height: 12px;
    border: 2px solid var(--mj-outline);
    border-radius: 6px;
    background: var(--mj-white);
    overflow: hidden;
}
.game-progress__fill {
    display: block;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--mj-pink) 0 8px, var(--mj-purple) 8px 16px);
}

.game-card__cta {
    display: block;
    margin: 16px 18px 18px;
    padding: 11px 0;
    text-align: center;
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    font-family: var(--mj-font-pixel);
    font-size: 13px;
    letter-spacing: 0.14em;
    color: var(--mj-white);
    background: var(--game-color);
    box-shadow: 3px 3px 0 var(--mj-outline);
    text-shadow: 1px 1px 0 rgba(74, 54, 48, 0.4);
}
.game-card--developing .game-card__cta {
    background: var(--mj-white);
    color: var(--mj-purple);
    text-shadow: none;
}
.game-empty {
    text-align: center;
    color: var(--mj-text-soft);
    background: var(--mj-white);
    border: 3px dashed var(--mj-outline);
    border-radius: 14px;
    padding: 34px 20px;
}

/* ゲーム個別ページ (single-mj_game.php) */
.single-game { padding: 20px 32px 80px; }
.single-game__inner { max-width: 900px; margin: 0 auto; }
.game-detail__frame {
    position: relative;
    border: 3px solid var(--mj-outline);
    border-radius: var(--mj-radius-lg);
    padding: 18px;
    background: var(--mj-white);
    box-shadow: var(--mj-shadow);
}
.game-detail__main { position: relative; display: grid; place-items: center; margin-bottom: 16px; }
.game-detail__img { width: 100%; max-height: 480px; object-fit: contain; border-radius: 12px; }
.game-detail__badge {
    position: absolute;
    top: 12px; left: 12px;
    padding: 5px 16px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    font-family: var(--mj-font-pixel);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--mj-white);
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.4);
}
.game-detail__badge.game-card--released   { background: var(--mj-pink); }
.game-detail__badge.game-card--developing { background: var(--mj-purple); }
.game-detail__desc {
    background: var(--mj-yellow-soft);
    border: 3px solid var(--mj-outline);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--mj-text);
    margin: 0 0 18px;
}

@media (max-width: 960px) {
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .game-board { padding: 4px 14px 56px; }
    .game-grid { grid-template-columns: 1fr; gap: 16px; }
    .game-section { margin-bottom: 36px; }
    .game-section__count { margin-left: 0; }
    .game-card__body { padding: 14px 14px 0; }
    .game-card__cta { margin: 14px 14px 14px; }
    .single-game { padding: 8px 14px 56px; }
    .game-detail__frame { padding: 14px; }
    .game-detail__img { max-height: 300px; }
}

/* =========================================================
   ゲーム メイン画像ギャラリー（複数画像対応）
   ========================================================= */
.game-card__imgcount {
    position: absolute;
    right: 10px; bottom: 10px;
    padding: 3px 10px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    font-family: var(--mj-font-pixel);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--mj-text);
    background: var(--mj-white);
    box-shadow: 2px 2px 0 rgba(74, 54, 48, 0.25);
}

.game-gallery { display: block; width: 100%; }
.game-gallery__stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    border: 3px solid var(--mj-outline);
    border-radius: 12px;
    overflow: hidden;
    background: var(--mj-purple-soft);
}
.game-gallery__main {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    transition: opacity 0.18s ease;
}
.game-gallery__main.is-switching { opacity: 0.35; }
.game-gallery__thumbs {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.game-gallery__thumb {
    display: block;
    width: 92px; height: 66px;
    padding: 0;
    border: 3px solid var(--mj-outline);
    border-radius: 10px;
    overflow: hidden;
    background: var(--mj-white);
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(74, 54, 48, 0.18);
    transition: transform 0.12s steps(2, end), border-color 0.12s ease;
}
.game-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-gallery__thumb:hover { transform: translate(-1px, -1px); }
.game-gallery__thumb.is-active { border-color: var(--mj-pink); }
.game-gallery__thumb:focus-visible { outline: 3px solid var(--mj-purple); outline-offset: 2px; }

@media (max-width: 640px) {
    .game-gallery__main { max-height: 300px; }
    .game-gallery__thumbs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 4px;
    }
    .game-gallery__thumb { flex: 0 0 auto; width: 76px; height: 56px; }
}

/* =========================================================
   お問い合わせ 送信結果表示（Formspree 結果パネル）
   ========================================================= */
.contact-status[hidden] { display: none !important; }
.contact-status {
    display: none;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 18px 0 0;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.6;
    border: 3px solid var(--mj-outline);
}
.contact-status.is-visible {
    display: flex;
    animation: mj-status-in 0.28s ease both;
}
@keyframes mj-status-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
.contact-status__icon {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    margin-top: 1px;
    border: 2px solid var(--mj-outline);
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 15px; font-weight: 800;
    color: var(--mj-white);
    background: #999;
}
.contact-status__body { flex: 1 1 auto; min-width: 0; }
.contact-status__title { margin: 0; font-weight: 800; font-size: 15px; }
.contact-status__text { margin: 2px 0 0; font-weight: 600; font-size: 13px; opacity: 0.94; word-break: break-word; }

.contact-status--loading { background: var(--mj-purple-soft); color: #5b4a8a; }
.contact-status--loading .contact-status__icon { background: var(--mj-purple); animation: mj-spin 1.1s linear infinite; }
@keyframes mj-spin { to { transform: rotate(360deg); } }

.contact-status--success { background: var(--mj-green-soft); color: #2e7d4f; }
.contact-status--success .contact-status__icon { background: #35a86a; }

.contact-status--error { background: #ffe1e1; color: #b33232; }
.contact-status--error .contact-status__icon { background: #e05555; }

/* 送信ボタン: 送信中 */
.contact-submit:disabled { cursor: progress; opacity: 0.78; transform: none; box-shadow: 4px 4px 0 var(--mj-outline); }
.contact-submit__spin {
    display: inline-block;
    width: 14px; height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: var(--mj-white);
    border-radius: 50%;
    animation: mj-spin 0.7s linear infinite;
}

@media (max-width: 640px) {
    .contact-status { padding: 13px 14px; gap: 10px; }
    .contact-status__title { font-size: 14px; }
    .contact-status__text { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .contact-status.is-visible { animation: none; }
    .contact-status--loading .contact-status__icon,
    .contact-submit__spin { animation: none; }
}
