/* ============================================================
   ZOWARU / 集合体恐怖症ラボ
   Theme: Dark Science (不気味だけどクール)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root,
[data-theme="light"] {
    /* Clinical Lab Theme + Neumorphism（明るい研究所） */
    --bg:           #e6e9ef;
    --bg-elev:      #e6e9ef;
    --bg-card:      #e6e9ef;
    --bg-card-soft: #ecf0f5;
    --bg-dark:      #1c1f2e;
    --header-bg:    rgba(230, 233, 239, 0.92);
    --rule:         rgba(166, 174, 195, 0.45);
    --border:       transparent;
    --border-soft:  rgba(166, 174, 195, 0.18);

    /* Neumorphism dual-shadow */
    --shadow-light: rgba(255, 255, 255, 0.95);
    --shadow-dark:  rgba(166, 174, 195, 0.55);

    --accent:       #6B2FBE;
    --accent-light: #9B59B6;
    --accent-glow:  rgba(107, 47, 190, 0.18);
    --accent-soft:  rgba(107, 47, 190, 0.08);
    --danger:       #C0392B;
    --text:         #2d3142;
    --text-dim:     #5f6478;
    --text-mute:    #8a8f9c;

    /* グラデーションボタン用 */
    --btn-grad-start:  #7d3ad3;
    --btn-grad-end:    var(--accent);
    --btn-shadow-color: rgba(107, 47, 190, 0.35);
    --btn-shadow-hover: rgba(107, 47, 190, 0.45);
}

[data-theme="dark"] {
    /* Dark Soft UI（暗い実験室・夜間モード） */
    --bg:           #2a2d35;
    --bg-elev:      #2a2d35;
    --bg-card:      #2a2d35;
    --bg-card-soft: #323540;
    --bg-dark:      #14161c;
    --header-bg:    rgba(42, 45, 53, 0.88);
    --rule:         rgba(255, 255, 255, 0.10);
    --border:       transparent;
    --border-soft:  rgba(255, 255, 255, 0.06);

    --shadow-light: rgba(64, 68, 80, 0.55);
    --shadow-dark:  rgba(8, 10, 14, 0.6);

    --accent:       #9B59B6;
    --accent-light: #BE89D8;
    --accent-glow:  rgba(155, 89, 182, 0.30);
    --accent-soft:  rgba(155, 89, 182, 0.14);
    --danger:       #E67E73;
    --text:         #e8eaf0;
    --text-dim:     #a8acba;
    --text-mute:    #6e7280;

    --btn-grad-start:  #B07CD2;
    --btn-grad-end:    var(--accent);
    --btn-shadow-color: rgba(155, 89, 182, 0.50);
    --btn-shadow-hover: rgba(155, 89, 182, 0.60);
}

:root {
    --neu-raised:
        -5px -5px 14px var(--shadow-light),
         6px  6px 18px var(--shadow-dark);
    --neu-raised-sm:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark);
    --neu-raised-lg:
        -8px -8px 22px var(--shadow-light),
         10px 10px 26px var(--shadow-dark);
    --neu-inset:
        inset -3px -3px 7px var(--shadow-light),
        inset  4px  4px 10px var(--shadow-dark);
    --neu-pressed:
        inset -2px -2px 4px var(--shadow-light),
        inset  3px  3px 6px var(--shadow-dark);

    --radius:       12px;
    --radius-lg:    18px;
    --radius-pill:  999px;
}

html { color-scheme: light dark; }
[data-theme="light"] html, html[data-theme="light"] { color-scheme: light; }
[data-theme="dark"]  html, html[data-theme="dark"]  { color-scheme: dark; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', 'Noto Sans JP', sans-serif;
    font-feature-settings: "palt";
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover { color: var(--text); }

button {
    font-family: inherit;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 1px 0 var(--shadow-light), 0 4px 20px var(--shadow-dark);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 16px;
}
/* メニュー（ナビ + ツール）をまとめて配置 */
.site-header__menu {
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-header__tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ブランドとメニューを繋ぐ研究器具風のブリッジライン */
.site-header__bridge {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    margin: 0 18px;
}
.site-header__bridge-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(123, 47, 190, 0.35);
    flex-shrink: 0;
}
.site-header__bridge-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        rgba(123, 47, 190, 0.30) 0px,
        rgba(123, 47, 190, 0.30) 4px,
        transparent 4px,
        transparent 10px
    );
    max-width: 280px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand__link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-decoration: none;
    color: inherit;
    gap: 3px;
}

.brand__logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.18em;
    color: var(--text);
}

.brand__logo-accent { color: var(--accent); }

.brand__acronym {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.06em;
    color: var(--text-mute);
    text-transform: uppercase;
    white-space: nowrap;
    margin-top: 2px;
}

.brand__acro-letter {
    color: var(--accent);
    font-weight: 700;
    font-size: 10.5px;
    margin-right: 0.5px;
}

.brand__sub {
    font-size: 10.5px;
    color: var(--text-dim);
    letter-spacing: 0.12em;
    margin-top: 1px;
}

/* ===== ハンバーガーボタン（モバイルのみ表示） ===== */
.nav-toggle {
    display: none;
    width: 36px; height: 36px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--bg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark);
    transition: box-shadow .2s, transform .2s;
}
.nav-toggle__bar {
    display: block;
    width: 16px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* タブレット以下：ハンバーガー出現＋メニュー縦ドロワー化 */
@media (max-width: 860px) {
    .site-header .container {
        gap: 10px;
    }
    .site-header__bridge { display: none; }
    .nav-toggle { display: inline-flex; }
    .site-header__menu {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 16px 20px 20px;
        background: var(--bg);
        box-shadow: 0 8px 24px var(--shadow-dark), inset 0 1px 0 var(--shadow-light);
        border-top: 1px solid rgba(0,0,0,0.04);
    }
    .site-header__menu.is-open { display: flex; }
    .site-header__menu .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    .site-header__menu .nav a {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        padding: 0 18px;
    }
    .site-header__tools {
        justify-content: space-between;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px dashed rgba(155, 89, 182, 0.18);
    }
}

/* スマホ：頭字語非表示・ロゴ縮小 */
@media (max-width: 540px) {
    .brand__acronym { display: none; }
    .brand__logo { font-size: 18px; letter-spacing: 0.14em; }
    .brand__sub { font-size: 9.5px; }
}

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}
.nav a {
    /* 均等サイズのニューモボタン（コンパクト） */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark),
        inset 0  1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(123, 47, 190, 0.04);
    transition: color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.nav a:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         5px  5px 12px var(--shadow-dark),
        inset 0  1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 0 rgba(123, 47, 190, 0.06);
}
.nav a:active {
    transform: translateY(0);
    box-shadow:
        inset -2px -2px 5px var(--shadow-light),
        inset  3px  3px 6px var(--shadow-dark);
}
.nav a.is-active {
    color: var(--accent);
    box-shadow:
        inset -2px -2px 5px var(--shadow-light),
        inset  3px  3px 6px var(--shadow-dark);
}

/* テーマ切替ボタン（☾/☀） */
.theme-toggle {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    box-shadow: var(--neu-raised-sm);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: box-shadow .2s, color .2s, transform .2s;
    padding: 0;
    line-height: 1;
}
.theme-toggle:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}
.theme-toggle:active {
    transform: translateY(0);
    box-shadow: var(--neu-pressed);
}
.theme-toggle__icon { display: block; }

/* 言語スイッチャー（コンパクト・ピル型 neu トグル） */
.lang-switch {
    display: inline-flex;
    margin-left: 0;
    padding: 2px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    box-shadow: var(--neu-inset);
}
.lang-switch__item {
    font-size: 9.5px;
    letter-spacing: 0.08em;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    color: var(--text-mute);
    text-transform: none;
    transition: color .2s, box-shadow .2s, background .2s;
}
.lang-switch__item:hover {
    color: var(--text);
}
.lang-switch__item.is-active {
    color: var(--accent);
    background: var(--bg);
    box-shadow: var(--neu-raised-sm);
}

/* ---------- Hero ---------- */
.hero {
    padding: 80px 0 56px;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 720px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
}

.hero__tagline {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 28px;
}

/* メインタイトル：研究機関のネームプレート風 */
.hero__title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(28px, 6vw, 56px);
    letter-spacing: 0.22em;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 4px;
    text-indent: 0.22em; /* 左寄せ補正で中央視覚バランス */
}

/* タイトル直下の研究所っぽい分割線 ─── SUBJECT ─── */
.hero__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 28px 0 20px;
}
.hero__divider hr {
    width: 56px;
    height: 1px;
    border: none;
    background: var(--border);
    margin: 0;
}
.hero__divider span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.34em;
    color: var(--text-mute);
}

/* サブタイトル：標本のキャプション風 明朝 */
.hero__subtitle {
    font-family: 'Noto Serif JP', 'Noto Sans JP', serif;
    font-weight: 400;
    font-size: clamp(13px, 1.7vw, 17px);
    color: var(--text);
    letter-spacing: 0.12em;
    margin: 0 auto 8px;
    line-height: 1.6;
    text-align: center;
}
.hero__subtitle em {
    font-style: normal;
    color: var(--accent-light);
}

.hero__lead {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

/* ---------- Section ---------- */
.section {
    padding: 56px 0;
}

.section__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    position: relative;
}
.section__head::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rule), transparent);
}

.section__title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.section__title small {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 400;
}

.section__more {
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* セクション下部の「もっと見る」ニューモボタン */
.section__more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}
.section__more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-decoration: none;
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         5px  5px 12px var(--shadow-dark),
        inset 0  1px 0 rgba(255, 255, 255, 0.75),
        inset 0 -1px 0 rgba(123, 47, 190, 0.04);
    transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}
.section__more-btn:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow:
        -5px -5px 12px var(--shadow-light),
         6px  6px 14px var(--shadow-dark),
        inset 0  1px 0 rgba(255, 255, 255, 0.85);
}
.section__more-btn:active {
    transform: translateY(0);
    box-shadow:
        inset -3px -3px 7px var(--shadow-light),
        inset  4px  4px 8px var(--shadow-dark);
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ---------- Card ---------- */
.card {
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--neu-raised);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--neu-raised-lg);
}

.card__image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--bg-dark);
    margin: 12px 12px 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease, filter .5s ease;
    filter: saturate(1.0);
}

.card:hover .card__image {
    transform: scale(1.04);
    filter: saturate(1.15) contrast(1.05);
}

.card__level {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    border: none;
}

.card__level.level-1 { color: #B6F0C8; }
.card__level.level-2 { color: #FFE0A0; }
.card__level.level-3 { color: #FFB0A8; }
.card__level.level-4 { color: #FFA0CF; }

.card__genre {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    color: var(--genre-accent, #fff);
    border: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* image.php レベルチップ（情報エリア内・インライン表示） */
.img-level-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
}
.img-level-chip.level-1 { color: #B6F0C8; }
.img-level-chip.level-2 { color: #FFE0A0; }
.img-level-chip.level-3 { color: #FFB0A8; }
.img-level-chip.level-4 { color: #FFA0CF; }

/* image.php ジャンルタグ */
.image-genre-tag {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    margin-bottom: 28px;
    text-decoration: none;
    box-shadow: var(--neu-raised-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    border-left: 4px solid var(--genre-accent, var(--accent));
}
.image-genre-tag:hover {
    transform: translateX(4px);
    box-shadow: var(--neu-raised);
}
.image-genre-tag__icon { font-size: 28px; line-height: 1; }
.image-genre-tag__label {
    display: block;
    color: var(--genre-accent, var(--text));
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.image-genre-tag__desc {
    display: block;
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.6;
}

.card__body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card__title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.04em;
}

/* ---------- Vote Buttons ---------- */
.vote {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.vote__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.06em;
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .2s ease, transform .2s ease, color .2s ease;
}

.vote__btn:hover:not(:disabled) {
    box-shadow: var(--neu-raised);
    transform: translateY(-1px);
    color: var(--accent);
}

.vote__btn:active:not(:disabled) {
    box-shadow: var(--neu-pressed);
    transform: translateY(0);
}

.vote__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: var(--neu-pressed);
}

.vote__btn.is-voted {
    box-shadow: var(--neu-inset);
    color: var(--accent);
}

.vote__btn--zowa .vote__label { color: var(--accent-light); }
.vote__btn--brave .vote__label { color: var(--text-dim); }

.vote__label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.vote__count {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
}

/* ---------- Ratio Bar ---------- */
.ratio {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ratio__bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: var(--neu-pressed);
}

.ratio__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width .4s ease;
}

/* ---------- Genre Icon SVG (シック・モノライン) ---------- */
.genre-icon-svg {
    display: inline-block;
    vertical-align: -0.18em;
    flex-shrink: 0;
}
.card__genre .genre-icon-svg,
.filter-chip .genre-icon-svg {
    vertical-align: -0.22em;
    margin-right: 2px;
}

/* ---------- Featured Specimen (TOPの主役パネル) ---------- */
.featured-specimen {
    padding: 24px 0 48px;
    position: relative;
}

.featured-specimen__tag {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.featured-specimen__panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 32px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--neu-raised-lg);
}

/* 角の研究所マーカー */
.featured-specimen__panel::before,
.featured-specimen__panel::after {
    content: '';
    position: absolute;
    width: 28px; height: 28px;
    border: 1px solid var(--accent);
    pointer-events: none;
}
.featured-specimen__panel::before {
    top: -1px; left: -1px;
    border-right: none; border-bottom: none;
}
.featured-specimen__panel::after {
    bottom: -1px; right: -1px;
    border-left: none; border-top: none;
}

.featured-specimen__image-wrap {
    position: relative;
    background: var(--bg-dark);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: block;
    box-shadow: var(--neu-inset);
}

.featured-specimen__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.0);
    transition: filter .4s ease, transform .4s ease;
}

.featured-specimen__image-wrap:hover .featured-specimen__image {
    filter: saturate(1.15) contrast(1.05);
    transform: scale(1.02);
}

/* 写真の上に重ねる撮影情報メタ */
.featured-specimen__crop {
    position: absolute;
    top: 12px; left: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text);
    background: rgba(0, 0, 0, 0.65);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 2px;
    z-index: 2;
}

.featured-specimen__scope {
    position: absolute;
    bottom: 12px; right: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.65);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 2px;
    z-index: 2;
}

/* 右側 情報パネル */
.featured-specimen__info {
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}

.featured-specimen__id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.32em;
    color: var(--text-mute);
    margin-bottom: 12px;
}

.featured-specimen__title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(26px, 3.5vw, 36px);
    letter-spacing: 0.18em;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.2;
}

.featured-specimen__en {
    font-family: 'Noto Serif JP', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.featured-specimen__data {
    display: grid;
    grid-template-columns: 110px 1fr;
    row-gap: 10px;
    column-gap: 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    margin-bottom: 20px;
}

.featured-specimen__data dt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--text-mute);
    text-transform: uppercase;
    align-self: center;
}

.featured-specimen__data dd {
    font-size: 13px;
    color: var(--text);
    letter-spacing: 0.06em;
}

.featured-specimen__data .dots {
    letter-spacing: 0.3em;
    color: var(--accent-light);
    margin-right: 6px;
}

.featured-specimen__desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.95;
    margin-bottom: 24px;
}

.featured-specimen__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    color: var(--accent);
    background: var(--bg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .25s, transform .25s;
    text-decoration: none;
}

.featured-specimen__cta:hover {
    color: var(--accent);
    transform: translateX(4px);
    box-shadow: var(--neu-raised);
}
.featured-specimen__cta:active {
    transform: translateX(0);
    box-shadow: var(--neu-pressed);
}

@media (max-width: 760px) {
    .featured-specimen__panel {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    .featured-specimen__data {
        grid-template-columns: 90px 1fr;
    }
}

/* ---------- Marquee (auto-scroll sample stream) ---------- */
.marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 8px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
    display: flex;
    gap: 16px;
    width: max-content;
    /* item数 × 5.5秒（多いほどゆっくり全体移動） */
    animation: marquee-scroll calc(var(--items, 12) * 5.5s) linear infinite;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee__item {
    flex: 0 0 240px;
    height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
    border: none;
    background: var(--bg-dark);
    position: relative;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: var(--neu-raised-sm);
}

.marquee__item:hover {
    transform: scale(1.06);
    z-index: 2;
    box-shadow: var(--neu-raised-lg);
}

.marquee__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.95);
    transition: filter .3s ease;
    display: block;
}

.marquee__item:hover img {
    filter: saturate(1.15) contrast(1.05);
}

.marquee__item__meta {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 12px;
    pointer-events: none;
}

.marquee__item__level {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    border: none;
    color: #fff;
    text-shadow: none;
}
.marquee__item__level.level-1 { color: #B6F0C8; }
.marquee__item__level.level-2 { color: #FFE0A0; }
.marquee__item__level.level-3 { color: #FFB0A8; }
.marquee__item__level.level-4 { color: #FFA0CF; }

.marquee__item__title {
    align-self: flex-end;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.78);
    padding: 5px 12px;
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-shadow: none;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------- Diagnosis History Summary (mypage) ---------- */
.diag-history-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr 1fr;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    margin-bottom: 24px;
}
.diag-history-summary__num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.diag-history-summary__arrow {
    color: var(--text-mute);
    font-size: 24px;
    font-family: 'JetBrains Mono', monospace;
}
.diag-history-summary__diff {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}
@media (max-width: 640px) {
    .diag-history-summary {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 20px;
    }
    .diag-history-summary__arrow { display: none; }
    .diag-history-summary__diff { border-left: none; padding-left: 0; grid-column: 1 / -1; }
}

/* ---------- Genre Kings (ranking) ---------- */
.genre-kings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.king-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--neu-raised-sm);
}
.king-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--neu-raised-lg);
}
.king-card__image {
    aspect-ratio: 16 / 9;
    background: var(--bg-dark);
    overflow: hidden;
    margin: 10px 10px 0;
    border-radius: var(--radius);
}
.king-card__image img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: saturate(0.9);
    transition: filter .3s ease;
}
.king-card:hover .king-card__image img { filter: saturate(1.1); }

.king-card__body {
    padding: 14px 16px;
}

.king-card__genre {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.king-card__icon { font-size: 16px; line-height: 1; }

.king-card__title {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.king-card__stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}
.king-card__zowa {
    color: var(--accent-light);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

/* ---------- Filter Chips (gallery) ---------- */
.filter-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.28em;
    color: var(--text-mute);
    text-transform: uppercase;
    margin: 0 0 10px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-row--sort {
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 32px;
}

.filter-chip {
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--bg);
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.06em;
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .2s, color .2s, transform .2s;
}

.filter-chip:hover {
    color: var(--chip-accent, var(--accent));
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}

.filter-chip.is-active {
    color: var(--chip-accent, var(--accent));
    box-shadow: var(--neu-inset);
    background: var(--bg);
    transform: translateY(0);
}

/* ---------- Diagnosis CTA (TOP) ---------- */
.diag-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
    padding: 36px 40px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--neu-raised-lg);
}
.diag-cta::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 36px; height: 36px;
    border: 1px solid var(--accent);
    border-right: none; border-bottom: none;
    pointer-events: none;
}
.diag-cta::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 36px; height: 36px;
    border: 1px solid var(--accent);
    border-left: none; border-top: none;
    pointer-events: none;
}
.diag-cta__tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.diag-cta__title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(22px, 3.2vw, 32px);
    letter-spacing: 0.14em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}
.diag-cta__title em {
    font-style: normal;
    color: var(--accent-light);
}
.diag-cta__desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.9;
}
.diag-cta__btn {
    display: inline-flex;
    align-items: center;
    padding: 18px 32px;
    background: linear-gradient(145deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #fff;
    border-radius: var(--radius-pill);
    letter-spacing: 0.14em;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         5px  5px 14px var(--btn-shadow-color);
    transition: box-shadow .25s, transform .25s;
    text-decoration: none;
}
.diag-cta__btn:hover {
    color: #fff;
    transform: translateX(4px);
    box-shadow:
        -5px -5px 14px var(--shadow-light),
         8px  8px 22px var(--btn-shadow-hover);
}
.diag-cta__btn:active {
    transform: translateX(0);
    box-shadow:
        inset -2px -2px 5px rgba(255,255,255,0.25),
        inset  3px  3px 6px rgba(0,0,0,0.18);
}
@media (max-width: 720px) {
    .diag-cta { grid-template-columns: 1fr; padding: 28px 24px; }
    .diag-cta__btn { justify-content: center; }
}

/* コンパクト版（HERO 直下用・縦積み中央寄せ） */
.diag-cta--compact {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 26px 30px 28px;
    gap: 18px;
    box-shadow: var(--neu-raised);
}
.diag-cta--compact .diag-cta__copy {
    max-width: 640px;
}
.diag-cta--compact .diag-cta__tag {
    font-size: 10px;
    margin-bottom: 6px;
    letter-spacing: 0.28em;
}
.diag-cta--compact .diag-cta__title {
    font-size: clamp(18px, 2.6vw, 26px);
    margin-bottom: 6px;
    line-height: 1.4;
    letter-spacing: 0.1em;
}
.diag-cta--compact .diag-cta__desc {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-dim);
}
.diag-cta--compact .diag-cta__btn {
    padding: 13px 30px;
    font-size: 12px;
    justify-content: center;
}
.diag-cta--compact .diag-cta__btn:hover {
    /* 縦積みなのでホバーアニメは上方向に */
    transform: translateY(-2px);
}
.diag-cta--compact .diag-cta__btn:active {
    transform: translateY(0);
}
@media (max-width: 720px) {
    .diag-cta--compact { padding: 20px 22px 22px; gap: 12px; }
}

/* ---------- Diagnosis (耐性診断) ---------- */
.diag-screen {
    text-align: center;
    padding: 40px 0;
}

.diag-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.diag-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(36px, 6vw, 64px);
    letter-spacing: 0.24em;
    color: var(--text);
    margin-bottom: 8px;
    text-indent: 0.24em;
    line-height: 1.1;
}

.diag-subtitle {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-dim);
    margin-bottom: 32px;
    letter-spacing: 0.14em;
}
.diag-subtitle em { font-style: normal; color: var(--accent-light); }

.diag-spec {
    display: grid;
    grid-template-columns: 120px 1fr;
    row-gap: 12px;
    column-gap: 12px;
    padding: 22px 32px;
    margin: 0 auto 32px;
    max-width: 520px;
    text-align: left;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--neu-inset);
}
.diag-spec dt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--text-mute);
}
.diag-spec dd {
    font-size: 13px;
    color: var(--text);
    letter-spacing: 0.06em;
}

.diag-warning {
    font-size: 12px;
    color: var(--text-mute);
    line-height: 1.9;
    margin-bottom: 32px;
}

.diag-btn-primary {
    display: inline-block;
    padding: 16px 36px;
    background: linear-gradient(145deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.16em;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         5px  5px 14px var(--btn-shadow-color);
    transition: box-shadow .25s ease, transform .25s ease;
    font-family: inherit;
    text-decoration: none;
}
.diag-btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        -5px -5px 14px var(--shadow-light),
         7px  7px 18px var(--btn-shadow-hover);
}
.diag-btn-primary:active {
    transform: translateY(0);
    box-shadow:
        inset -2px -2px 5px rgba(255,255,255,0.25),
        inset  3px  3px 6px rgba(0,0,0,0.18);
}
.diag-btn-primary:disabled,
.diag-btn-primary[disabled] {
    cursor: not-allowed;
    color: var(--text-mute);
    background: var(--bg);
    box-shadow: var(--neu-pressed);
    transform: none;
    pointer-events: none;
    opacity: 0.7;
}
.diag-btn-primary:disabled:hover,
.diag-btn-primary[disabled]:hover {
    transform: none;
    box-shadow: var(--neu-pressed);
}

.diag-btn-secondary {
    display: inline-block;
    padding: 14px 24px;
    background: var(--bg);
    color: var(--text-dim);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.14em;
    font-size: 12px;
    text-transform: uppercase;
    text-decoration: none;
    font-family: inherit;
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .25s, color .25s, transform .25s;
}
.diag-btn-secondary:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}
.diag-btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--neu-pressed);
}

/* プレイ画面 */
.diag-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.diag-progress__count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    min-width: 50px;
}
.diag-progress__bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: var(--neu-pressed);
}
.diag-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width .4s ease;
}

.diag-image-wrap {
    position: relative;
    background: #1c1f2e;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(28, 31, 46, 0.08);
}

.diag-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.diag-level-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    padding: 5px 12px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid var(--border);
    color: var(--text);
}
.diag-level-badge.level-1 { color: #8DDBA5; border-color: #2a4f36; }
.diag-level-badge.level-2 { color: #F2C66B; border-color: #5a4520; }
.diag-level-badge.level-3 { color: var(--danger); border-color: #6e2a23; }

.diag-genre-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid var(--genre-accent, var(--border));
    color: var(--genre-accent, var(--text));
}

/* レーダーチャート */
.diag-radar-wrap {
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.diag-radar {
    display: flex;
    justify-content: center;
    margin: 16px auto 32px;
}
#diag-radar-svg {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.diag-genre-list {
    max-width: 480px;
    margin: 0 auto 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.diag-genre-row {
    display: grid;
    grid-template-columns: 26px 100px 1fr 56px;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}
.diag-genre-row__icon { font-size: 16px; }
.diag-genre-row__name {
    color: var(--text);
    text-align: left;
    letter-spacing: 0.08em;
}
.diag-genre-row__bar {
    height: 10px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
    box-shadow: var(--neu-pressed);
}
.diag-genre-row__bar span {
    display: block;
    height: 100%;
    transition: width 1s cubic-bezier(.2,.8,.2,1);
}
.diag-genre-row__pct {
    text-align: right;
    color: var(--text-dim);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 13px;
}

/* 注意モーダル（試験スタート前の最終確認） */
.diag-modal {
    /* 画面中央に配置（inset:0 + margin:auto は dialog の標準パターン） */
    position: fixed;
    inset: 0;
    margin: auto;
    border: none;
    background: transparent;
    padding: 0;
    max-width: 480px;
    width: 90%;
    height: -moz-max-content;
    height: max-content;
    max-height: 90vh;
    color: var(--text);
}
.diag-modal::backdrop {
    background: rgba(28, 31, 46, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.diag-modal__inner {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised-lg);
    padding: 36px 30px 30px;
    text-align: center;
}
.diag-modal__icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--neu-inset);
    color: var(--danger);
}
.diag-modal__title {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.22em;
    color: var(--danger);
    margin-bottom: 18px;
    text-indent: 0.22em;
}
.diag-modal__body {
    font-size: 13px;
    line-height: 2;
    color: var(--text-dim);
    margin-bottom: 28px;
}
.diag-modal__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
/* アニメは inner に分離（dialog自体の transform は中央配置を壊すため） */
.diag-modal[open] .diag-modal__inner {
    animation: diagModalIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes diagModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@media (max-width: 480px) {
    .diag-modal__inner { padding: 28px 20px 22px; }
    .diag-modal__title { font-size: 18px; }
    .diag-modal__actions .diag-btn-primary,
    .diag-modal__actions .diag-btn-secondary {
        width: 100%;
    }
}

/* プロフィール入力フォーム（結果直前） */
.profile-form {
    max-width: 480px;
    margin: 24px auto 0;
    text-align: left;
}

/* 匿名性アピール（記入率UPの安心感）*/
.profile-privacy {
    margin-top: 32px;
    text-align: center;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.06em;
    line-height: 1.7;
}

/* 結果ボタンを中央に */
.diag-actions--profile {
    justify-content: center;
    margin-top: 18px;
}

/* スキップは控えめなテキストリンクに */
.profile-skip-wrap {
    text-align: center;
    margin: 18px 0 0;
}
.profile-skip-link {
    background: none;
    border: none;
    color: var(--text-mute);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-decoration: underline;
    text-decoration-color: rgba(0,0,0,0.12);
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
    opacity: 0.7;
    transition: opacity .2s, color .2s;
}
.profile-skip-link:hover {
    opacity: 1;
    color: var(--text-dim);
}
.profile-row {
    margin-bottom: 24px;
}
.profile-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--text-mute);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.profile-radios {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-radio {
    flex: 1 1 90px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    box-shadow: var(--neu-raised-sm);
    padding: 10px 16px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    color: var(--text);
    transition: box-shadow .2s, color .2s, transform .2s;
    position: relative;
    user-select: none;
}
.profile-radio:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}
.profile-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.profile-radio.is-active {
    box-shadow: var(--neu-inset);
    color: var(--accent);
    transform: translateY(0);
}
.profile-select {
    width: 100%;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-pill);
    box-shadow: var(--neu-inset);
    padding: 12px 20px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                      linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}
.profile-select:focus {
    outline: none;
    box-shadow: var(--neu-inset), 0 0 0 2px var(--accent-soft);
}

/* ============================================================
   Result Visualizations（試験管ラック / スペクトラム帯 / レーダー）
   ============================================================ */
:root {
    --rv-trigger: #D96B6B;
    --rv-calm:    #7FB069;
}

.rv-wrap {
    margin-top: 32px;
}
.rv-section {
    margin-bottom: 36px;
}
.rv-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--accent-light);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 16px;
}

/* 代表標本サムネ（共通） */
.rv-circle {
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-dark);
    border: 2px solid var(--rv-genre-color, var(--accent));
    box-shadow: var(--neu-raised-sm);
}
.rv-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── 試験管ラック ── */
.rv-tubes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 22px 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--neu-inset);
}
.rv-tube-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.rv-tube-cell .rv-circle {
    width: 38px;
    height: 38px;
    margin-bottom: 6px;
}
.rv-tube-name {
    font-size: 10.5px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    line-height: 1.2;
    min-height: 13px;
}
.rv-tube-svg {
    width: 100%;
    max-width: 50px;
    height: 130px;
    margin-bottom: 6px;
}
.rv-tube-pct {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    line-height: 1;
}
.rv-tube-zowa {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    color: var(--text-mute);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 3px;
}
@media (max-width: 640px) {
    .rv-tubes { gap: 2px; padding: 14px 4px; }
    .rv-tube-cell .rv-circle { width: 28px; height: 28px; }
    .rv-tube-name { font-size: 9px; }
    .rv-tube-svg { height: 100px; }
    .rv-tube-pct { font-size: 12px; }
    .rv-tube-zowa { font-size: 7.5px; }
}

/* ── スペクトラム帯 ── */
.rv-spectrum-wrap { padding: 8px 0 40px; }
.rv-spectrum-track {
    position: relative;
    height: 12px;
    background: linear-gradient(90deg,
        rgba(127, 176, 105, 0.55) 0%,
        rgba(217, 178, 107, 0.55) 50%,
        rgba(217, 107, 107, 0.55) 100%);
    border-radius: var(--radius-pill);
    box-shadow: var(--neu-inset);
    /* 3レーン分のラベルスペース */
    margin: 160px 24px 120px;
}
.rv-spectrum-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    z-index: 2;
    transition: transform .25s;
}
.rv-spectrum-dot:hover {
    transform: translate(-50%, -50%) scale(1.18);
    z-index: 3;
}
.rv-spectrum-dot .rv-circle {
    width: 100%; height: 100%;
    border-width: 2.5px;
}
.rv-spectrum-pct {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}
.rv-spectrum-pct__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.rv-spectrum-pct__zowa {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    color: var(--text-mute);
    letter-spacing: 0.2em;
    margin-top: 2px;
    text-transform: uppercase;
}
.rv-spectrum-name {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

/* ── レーン配置：data-lane属性で0/1/2段の高さに振り分け ── */
.rv-spectrum-dot[data-lane="0"] .rv-spectrum-pct  { top: -42px; }
.rv-spectrum-dot[data-lane="0"] .rv-spectrum-name { bottom: -26px; }

.rv-spectrum-dot[data-lane="1"] .rv-spectrum-pct  { top: -86px; }
.rv-spectrum-dot[data-lane="1"] .rv-spectrum-name { bottom: -60px; }

.rv-spectrum-dot[data-lane="2"] .rv-spectrum-pct  { top: -130px; }
.rv-spectrum-dot[data-lane="2"] .rv-spectrum-name { bottom: -94px; }

/* 引き出し補助線（レーン1・2で表示） */
.rv-spectrum-dot[data-lane="1"] .rv-spectrum-pct::after,
.rv-spectrum-dot[data-lane="2"] .rv-spectrum-pct::after {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    width: 1px;
    background: linear-gradient(180deg, var(--text-mute), transparent);
    opacity: 0.45;
    transform: translateX(-50%);
}
.rv-spectrum-dot[data-lane="1"] .rv-spectrum-pct::after { height: 26px; }
.rv-spectrum-dot[data-lane="2"] .rv-spectrum-pct::after { height: 70px; }

.rv-spectrum-dot[data-lane="1"] .rv-spectrum-name::before,
.rv-spectrum-dot[data-lane="2"] .rv-spectrum-name::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    width: 1px;
    background: linear-gradient(0deg, var(--text-mute), transparent);
    opacity: 0.45;
    transform: translateX(-50%);
}
.rv-spectrum-dot[data-lane="1"] .rv-spectrum-name::before { height: 22px; }
.rv-spectrum-dot[data-lane="2"] .rv-spectrum-name::before { height: 56px; }
.rv-spectrum-scale {
    display: flex;
    justify-content: space-between;
    margin: 0 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.16em;
}
.rv-spectrum-labels {
    display: flex;
    justify-content: space-between;
    margin: 8px 24px 0;
    font-size: 10.5px;
    letter-spacing: 0.14em;
}
.rv-spectrum-labels .calm    { color: var(--rv-calm); }
.rv-spectrum-labels .trigger { color: var(--rv-trigger); }

/* ── レーダーチャート（画像が外側） ── */
.rv-radar-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}
.rv-radar-wrap svg {
    width: 100%;
    max-width: 460px;
}

/* 5段階タイプ一覧（スペクトラム） */
.diag-tiers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 620px;
    margin: 0 auto 12px;
}
.diag-tier {
    text-align: left;
    padding: 16px 22px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .3s ease, transform .3s ease, opacity .3s ease;
    position: relative;
    opacity: 0.55;
}
.diag-tier:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}
.diag-tier.is-active {
    box-shadow: var(--neu-raised-lg);
    opacity: 1;
    transform: scale(1.02);
    border-left: 3px solid var(--accent);
    padding-left: 19px;
}
.diag-tier__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.diag-tier__name {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text);
}
.diag-tier.is-active .diag-tier__name { color: var(--accent); }
.diag-tier__range {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-mute);
    white-space: nowrap;
}
.diag-tier__desc {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.75;
    margin: 0;
}
.diag-tier__badge {
    position: absolute;
    top: -10px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.22em;
    padding: 4px 12px;
    background: linear-gradient(145deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #fff;
    border-radius: var(--radius-pill);
    box-shadow:
        -2px -2px 6px var(--shadow-light),
         3px  3px 8px var(--btn-shadow-color);
    display: none;
    text-transform: uppercase;
}
.diag-tier.is-active .diag-tier__badge { display: block; }

/* ─── アコーディオン版（<details>/<summary>） ─── */
.diag-tiers--accordion .diag-tier {
    padding: 0;
    opacity: 1;
    transform: none;
}
.diag-tiers--accordion .diag-tier:hover { transform: none; }
.diag-tiers--accordion .diag-tier.is-active {
    transform: none;
    padding-left: 0;
    border-left: none;
    box-shadow: var(--neu-raised);
}
.diag-tiers--accordion .diag-tier__head {
    padding: 16px 22px;
    margin: 0;
    cursor: pointer;
    list-style: none;
    align-items: center;
    gap: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease;
}
.diag-tiers--accordion .diag-tier__head::-webkit-details-marker,
.diag-tiers--accordion .diag-tier__head::marker { display: none; }
.diag-tiers--accordion .diag-tier__head:hover { background: rgba(107, 47, 190, 0.04); }
.diag-tiers--accordion .diag-tier.is-active .diag-tier__head {
    border-left-color: var(--accent);
    padding-left: 19px;
}
.diag-tiers--accordion .diag-tier__name {
    flex: 1;
    margin-right: auto;
}
.diag-tiers--accordion .diag-tier__arrow {
    font-size: 14px;
    color: var(--text-mute);
    transition: transform 0.25s ease;
    margin-left: 4px;
}
.diag-tiers--accordion .diag-tier[open] .diag-tier__arrow {
    transform: rotate(180deg);
    color: var(--accent);
}
.diag-tiers--accordion .diag-tier__body {
    padding: 4px 22px 22px;
    border-top: 1px dashed rgba(0,0,0,0.06);
    margin-top: -1px;
}
.diag-tiers--accordion .diag-tier.is-active .diag-tier__body {
    padding-left: 19px;
}
.diag-tier__body-text {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.95;
    margin: 16px 0 0;
}
.diag-tier__traits-label {
    margin: 22px 0 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.diag-tier__traits {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
}
.diag-tier__traits li {
    position: relative;
    padding-left: 18px;
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.6;
}
.diag-tier__traits li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 10px;
    top: 4px;
}
.diag-tiers--accordion .diag-tier__badge {
    position: static;
    display: none;
    margin-right: 6px;
    padding: 3px 10px;
    background: linear-gradient(145deg, var(--accent-light), var(--accent));
    box-shadow: none;
    color: #fff;
    font-size: 9px;
    letter-spacing: 0.18em;
    border-radius: var(--radius-pill);
}
.diag-tiers--accordion .diag-tier.is-active .diag-tier__badge { display: inline-block; }
@media (max-width: 640px) {
    .diag-tier__traits { grid-template-columns: 1fr; gap: 6px; }
    .diag-tier__body-text { font-size: 12.5px; }
    .diag-tiers--accordion .diag-tier__head { padding: 14px 16px; gap: 8px; }
    .diag-tiers--accordion .diag-tier.is-active .diag-tier__head { padding-left: 13px; }
    .diag-tiers--accordion .diag-tier__body { padding: 4px 16px 18px; }
    .diag-tiers--accordion .diag-tier.is-active .diag-tier__body { padding-left: 13px; }
    .diag-tier__name { font-size: 14px; }
    .diag-tier__range { font-size: 10px; }
}

.diag-weak-strong {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.9;
    padding: 18px 20px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--neu-inset);
}
.diag-weak-strong strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--accent-light);
    margin-right: 4px;
}

.diag-vote {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 520px;
    margin: 18px auto 0;
}
/* === 投票ボタン：洗練ピル（コンパクト版） === */
.diag-vote-btn {
    padding: 14px 16px;
    min-height: 54px;
    border: none;
    border-radius: var(--radius-pill, 999px);
    color: #ffffff;
    cursor: pointer;
    transition: box-shadow .25s ease, transform .25s ease, filter .25s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
/* 光沢を斜めに走らせる演出（ホバーで動く） */
.diag-vote-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-22deg);
    transition: left .55s ease;
    pointer-events: none;
}
.diag-vote-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
}
.diag-vote-btn:hover::before { left: 120%; }
.diag-vote-btn:active {
    transform: translateY(-1px);
    filter: brightness(0.96);
}
.diag-vote-btn__label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    position: relative;
    z-index: 1;
}

/* === 診断中止リンク（控えめテキストボタン） === */
.diag-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 22px auto 0;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-mute);
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}
.diag-cancel::before {
    content: "×";
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}
.diag-cancel:hover {
    color: var(--danger, #E74C3C);
    background: rgba(231, 76, 60, 0.06);
}
.diag-cancel-wrap {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}
/* ぞわった = 紫グラデ */
.diag-vote-btn--zowa {
    background: linear-gradient(135deg, #9B59B6 0%, #6B2FBE 100%);
    box-shadow:
        0 12px 28px rgba(107, 47, 190, 0.32),
        0 4px 8px rgba(107, 47, 190, 0.18);
}
.diag-vote-btn--zowa:hover {
    box-shadow:
        0 18px 36px rgba(107, 47, 190, 0.40),
        0 6px 12px rgba(107, 47, 190, 0.22);
}
/* 耐えた = グレーグラデ（中立色） */
.diag-vote-btn--brave {
    background: linear-gradient(135deg, #B8BFCD 0%, #6E7280 100%);
    box-shadow:
        0 12px 24px rgba(110, 114, 128, 0.30),
        0 4px 8px rgba(110, 114, 128, 0.16);
}
.diag-vote-btn--brave:hover {
    box-shadow:
        0 18px 32px rgba(110, 114, 128, 0.38),
        0 6px 12px rgba(110, 114, 128, 0.20);
}
@media (max-width: 480px) {
    .diag-vote-btn {
        padding: 20px 12px;
        min-height: 72px;
    }
    .diag-vote-btn__label { font-size: 17px; letter-spacing: 0.08em; }
}

/* 結果画面 */
.diag-score {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 24px auto 28px;
}
.diag-score__ring {
    width: 100%;
    height: 100%;
}
.diag-score__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: 'Space Grotesk', sans-serif;
    box-sizing: border-box;
    pointer-events: none;
}
/* 数字 + %（横並び・% は数字より小さく） */
.diag-score__num {
    font-size: 76px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.diag-score__pct {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-mute);
    line-height: 1;
    letter-spacing: 0.02em;
}
/* 「ぞわる」単位（数字の下・小さく） */
.diag-score__unit {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: var(--text-mute);
    line-height: 1;
    margin-top: 6px;
}

.diag-result-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.24em;
    color: var(--text-mute);
    margin-bottom: 12px;
}

.diag-result-tier {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0.22em;
    color: var(--accent-light);
    margin-bottom: 16px;
    text-indent: 0.22em;
}

.diag-result-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.9;
    max-width: 480px;
    margin: 0 auto 36px;
}

.diag-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

@media (max-width: 640px) {
    .diag-spec { grid-template-columns: 90px 1fr; padding: 16px 20px; }
    .diag-score { width: 180px; height: 180px; }
    .diag-score__num { font-size: 62px; }
    .diag-score__pct { font-size: 22px; }
    .diag-score__unit { font-size: 10px; margin-top: 4px; }
}

/* ---------- Community ---------- */
.community-form {
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 40px;
    position: relative;
    box-shadow: var(--neu-raised);
}
.community-form__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.community-form__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--accent-light);
}
.community-form__cancel {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.community-form__cancel:hover { color: var(--text); }
.community-form__error {
    padding: 12px 14px;
    margin-bottom: 14px;
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid var(--danger);
    border-radius: 4px;
    color: #ff9c92;
    font-size: 13px;
}
.community-form__row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.community-form__handle {
    flex: 1;
    padding: 12px 18px;
    background: var(--bg);
    border: none;
    color: var(--text);
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    box-shadow: var(--neu-inset);
}
.community-form__handle:focus { outline: none; box-shadow: var(--neu-inset), 0 0 0 2px var(--accent-soft); }
.community-form__ipid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.14em;
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--bg);
    box-shadow: var(--neu-pressed);
}
.community-form__body {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: none;
    color: var(--text);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    min-height: 110px;
    box-shadow: var(--neu-inset);
}
.community-form__body:focus { outline: none; box-shadow: var(--neu-inset), 0 0 0 2px var(--accent-soft); }
.community-form__body:focus { outline: none; border-color: var(--accent); }
.community-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}
.community-form__counter {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.08em;
}
.community-form__submit {
    padding: 12px 30px;
    background: linear-gradient(145deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.12em;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--btn-shadow-color);
    transition: box-shadow .2s ease, transform .2s ease;
    font-family: inherit;
}
.community-form__submit:hover {
    transform: translateY(-1px);
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         6px  6px 14px var(--btn-shadow-hover);
}
.community-form__submit:active {
    transform: translateY(0);
    box-shadow:
        inset -2px -2px 5px rgba(255,255,255,0.25),
        inset  3px  3px 6px rgba(0,0,0,0.18);
}

/* スレッド表示 */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.thread {
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: box-shadow .25s ease, transform .25s ease;
    box-shadow: var(--neu-raised-sm);
}
.thread:target,
.thread:hover {
    box-shadow: var(--neu-raised);
    transform: translateY(-1px);
}

.thread__head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}
.thread__handle {
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.04em;
}
.thread__ipid {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-light);
    font-size: 10px;
    letter-spacing: 0.14em;
}
.thread__date {
    color: var(--text-mute);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
}
.thread__no {
    margin-left: auto;
    color: var(--text-mute);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
}

.thread__body {
    color: var(--text);
    font-size: 14px;
    line-height: 1.85;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.thread__footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.thread__reply-btn {
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg);
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.06em;
    box-shadow: var(--neu-raised-sm);
    transition: box-shadow .2s, color .2s, transform .2s;
    font-family: inherit;
}
.thread__reply-btn:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--neu-raised);
}
.thread__reply-btn:active {
    transform: translateY(0);
    box-shadow: var(--neu-pressed);
}
.thread__reply-count {
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
}

.thread__replies {
    margin-top: 14px;
    padding-left: 20px;
    border-left: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reply {
    background: var(--bg);
    border: none;
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--neu-inset);
}
.reply__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 11px;
}
.reply__handle { color: var(--text); font-weight: 600; }
.reply__ipid {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-light);
    font-size: 10px;
    letter-spacing: 0.14em;
}
.reply__date { color: var(--text-mute); font-family: 'Space Grotesk', sans-serif; font-size: 10px; }
.reply__no { margin-left: auto; color: var(--text-mute); font-size: 10px; }
.reply__body {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.8;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

/* ---------- Report buttons ---------- */
.thread__report-btn,
.reply__report-btn {
    margin-left: auto;
    background: none;
    border: 1px solid transparent;
    color: var(--text-mute);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.06em;
    font-family: inherit;
    transition: color .2s, border-color .2s;
}
.thread__report-btn:hover,
.reply__report-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}
.thread__report-btn.is-reported,
.reply__report-btn.is-reported,
[data-report-type].is-reported {
    color: var(--text-mute);
    border-color: var(--text-mute);
    cursor: not-allowed;
}

/* ---------- SNS Share Buttons ---------- */
.share-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}
.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--neu-raised-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    cursor: pointer;
    transition: box-shadow .2s, color .2s, transform .2s;
    border: none;
    text-decoration: none;
    font-family: inherit;
    padding: 0;
}
.share-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--neu-raised);
}
.share-btn:active {
    transform: translateY(0);
    box-shadow: var(--neu-pressed);
}
/* ブランドカラーのアクセント（ホバー時のみ控えめに）*/
.share-btn--x:hover       { color: #0f1419; }
.share-btn--fb:hover      { color: #1877F2; }
.share-btn--line:hover    { color: #06C755; }
.share-btn--threads:hover { color: #000000; }
.share-btn--reddit:hover  { color: #FF4500; }
.share-btn--pin:hover     { color: #E60023; }
.share-btn--copy:hover    { color: var(--accent); }
.share-btn.is-copied {
    color: var(--accent);
    box-shadow: var(--neu-inset);
}
[data-theme="dark"] .share-btn--x:hover       { color: #f0f1f5; }
[data-theme="dark"] .share-btn--threads:hover { color: #f0f1f5; }

/* ===== X と FB は主力シェアとして強調（大きく・ブランドカラー） ===== */
.share-btn--x:not(.share-btn--cta),
.share-btn--fb:not(.share-btn--cta) {
    width: 64px;
    height: 64px;
}
.share-btn--x:not(.share-btn--cta) svg,
.share-btn--fb:not(.share-btn--cta) svg {
    width: 26px;
    height: 26px;
}
/* X — 黒地に白ロゴ */
.share-btn--x {
    background: #000000;
    color: #ffffff;
    box-shadow: var(--neu-raised);
}
.share-btn--x:hover {
    background: #1a1a1a;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--neu-raised-lg);
}
[data-theme="dark"] .share-btn--x {
    background: #ffffff;
    color: #000000;
}
[data-theme="dark"] .share-btn--x:hover {
    background: #e8e8e8;
    color: #000000;
}
/* Facebook — ブランド青に白ロゴ */
.share-btn--fb {
    background: #1877F2;
    color: #ffffff;
    box-shadow: var(--neu-raised);
}
.share-btn--fb:hover {
    background: #0d65d9;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--neu-raised-lg);
}
[data-theme="dark"] .share-btn--fb:hover {
    background: #0d65d9;
    color: #ffffff;
}

/* ===== Split レイアウト：X/FB＝大ラベル付きCTA、その他＝下段小アイコン ===== */
.share-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.share-split__primary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
.share-split__secondary {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
/* ── CTA（テキストラベル付きピル）共通 ── */
.share-btn--cta {
    width: auto;
    height: auto;
    min-height: 52px;
    padding: 0 22px 0 18px;
    border-radius: var(--radius-pill);
    gap: 10px;
    font-family: 'Noto Sans JP', 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: var(--neu-raised);
}
.share-btn--cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--neu-raised-lg);
}
.share-btn--cta .share-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}
.share-btn--cta .share-btn__icon svg {
    width: 22px;
    height: 22px;
}
.share-btn--cta .share-btn__label {
    display: inline-block;
    line-height: 1;
}
/* ── X CTA：黒地に白 ── */
.share-btn--x.share-btn--cta {
    background: #000000;
    color: #ffffff;
}
.share-btn--x.share-btn--cta:hover {
    background: #1a1a1a;
    color: #ffffff;
}
[data-theme="dark"] .share-btn--x.share-btn--cta {
    background: #ffffff;
    color: #000000;
}
[data-theme="dark"] .share-btn--x.share-btn--cta:hover {
    background: #e8e8e8;
    color: #000000;
}
/* ── FB CTA：ブランド青に白 ── */
.share-btn--fb.share-btn--cta {
    background: #1877F2;
    color: #ffffff;
}
.share-btn--fb.share-btn--cta:hover {
    background: #0d65d9;
    color: #ffffff;
}
[data-theme="dark"] .share-btn--fb.share-btn--cta:hover {
    background: #0d65d9;
    color: #ffffff;
}
@media (max-width: 480px) {
    .share-split__primary { flex-direction: column; width: 100%; }
    .share-btn--cta { width: 100%; justify-content: center; }
}

/* ---------- Stats ページ ---------- */
.stats-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
    .stats-grid--3 { grid-template-columns: 1fr; }
}
.stats-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised-sm);
    padding: 22px 24px;
    margin-top: 14px;
}
.stats-card--big {
    text-align: center;
    padding: 28px 22px;
    margin-top: 0;
}
.stats-card__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--text-mute);
    text-transform: uppercase;
}
.stats-card__num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.05;
    margin-top: 6px;
    letter-spacing: -0.02em;
}
.stats-card__num-suffix {
    font-size: 26px;
    font-weight: 500;
    color: var(--accent);
    margin-left: 4px;
}
.stats-card__unit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 4px;
    letter-spacing: 0.06em;
}
/* バー（5段階ティア分布） */
.stats-bar {
    display: grid;
    grid-template-columns: 140px 1fr 110px;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
}
.stats-bar + .stats-bar { border-top: 1px solid rgba(0,0,0,0.04); }
.stats-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.stats-bar__track {
    height: 10px;
    border-radius: 5px;
    background: var(--bg);
    box-shadow: var(--neu-inset);
    overflow: hidden;
    position: relative;
}
.stats-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-light), var(--accent));
    border-radius: 5px;
    transition: width 0.4s ease;
}
.stats-bar__val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    text-align: right;
}
.stats-bar__n { color: var(--text-mute); }

/* テーブル */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.stats-table th {
    text-align: left;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--text-mute);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-weight: 500;
}
.stats-table td {
    padding: 14px 12px;
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-mini-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 130px;
}
.stats-mini-bar span {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    min-width: 48px;
}
.stats-mini-bar .stats-bar__track { flex: 1; height: 6px; }
@media (max-width: 640px) {
    .stats-bar { grid-template-columns: 90px 1fr 90px; gap: 10px; font-size: 12px; }
    .stats-bar__val { font-size: 11px; }
    .stats-table { font-size: 11px; }
    .stats-table th, .stats-table td { padding: 8px 6px; }
    .stats-mini-bar span { font-size: 12px; min-width: 38px; }
}

/* ---------- 縦棒グラフ（BY TIER 5段階分布） ---------- */
.vbar-chart {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    padding: 8px 12px 4px;
    align-items: end;
}
.vbar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.vbar-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.3;
}
.vbar-n {
    display: block;
    font-size: 10px;
    color: var(--text-mute);
    font-weight: 500;
    margin-top: 2px;
}
.vbar-track {
    width: 100%;
    max-width: 64px;
    height: 220px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--neu-inset);
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.vbar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent-light));
    border-radius: var(--radius) var(--radius) 4px 4px;
    box-shadow: 0 -4px 12px rgba(107, 47, 190, 0.20);
    transition: height 0.5s cubic-bezier(.2,.8,.2,1);
    min-height: 4px;
}
.vbar-label {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.2;
    gap: 3px;
}
.vbar-label__name {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
}
.vbar-label__range {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.vbar-label__unit {
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 0.06em;
    font-weight: 500;
}
@media (max-width: 640px) {
    .vbar-chart { gap: 8px; padding: 6px 4px 4px; }
    .vbar-track { height: 160px; max-width: 36px; }
    .vbar-val { font-size: 10px; }
    .vbar-n { font-size: 9px; }
    .vbar-label__name { font-size: 11px; letter-spacing: 0.02em; }
    .vbar-label__range { font-size: 8px; }
    .vbar-label__unit { font-size: 9px; }
}

/* セグメント比較（性別・年齢・職業の平均スコア用） */
.vbar-chart--seg .vbar-track { height: 180px; max-width: 72px; }
.vbar-chart--seg .vbar-fill {
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
}
/* 職業は横スクロール許可（13件まである）+ ラベルを縦書きに近い長文対応 */
.vbar-chart--occ {
    overflow-x: auto;
    padding-bottom: 12px;
}
.vbar-chart--occ .vbar-track { max-width: 44px; }
.vbar-label__name--occ {
    font-size: 11px;
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-align: center;
}
@media (max-width: 640px) {
    .vbar-chart--seg .vbar-track { height: 140px; max-width: 50px; }
    .vbar-chart--occ .vbar-track { max-width: 30px; }
    .vbar-label__name--occ { font-size: 9px; }
}

/* ---------- 標本別ランキング（stats.php） ---------- */
.stats-bar--genre .stats-bar__label {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stats-bar__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.stats-table--specimen td {
    vertical-align: middle;
}
.spec-rank {
    text-align: center;
}
.spec-rank__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 14px;
    background: var(--bg);
    box-shadow: var(--neu-raised-sm);
    color: var(--text-dim);
}
.spec-rank__num.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; box-shadow: none; }
.spec-rank__num.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #fff; box-shadow: none; }
.spec-rank__num.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; box-shadow: none; }

/* 系統別バーのランク番号（小型） */
.stats-bar__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    margin-right: 8px;
    border-radius: 50%;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 11px;
    background: var(--bg);
    color: var(--text-dim);
    box-shadow: var(--neu-raised-sm);
    flex-shrink: 0;
}
.stats-bar__rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; box-shadow: none; }
.stats-bar__rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #fff; box-shadow: none; }
.stats-bar__rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; box-shadow: none; }
.spec-thumb {
    width: 56px; height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: var(--neu-raised-sm);
}
.spec-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.spec-level {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    box-shadow: var(--neu-inset);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    vertical-align: middle;
}
.spec-genre {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .stats-table--specimen {
        font-size: 10px;
    }
    .stats-table--specimen th,
    .stats-table--specimen td {
        padding: 6px 4px;
    }
    .spec-thumb { width: 44px; height: 44px; border-width: 2px; }
    .spec-rank__num { width: 26px; height: 26px; font-size: 12px; }
    .spec-level { font-size: 9px; padding: 1px 5px; }
    .spec-genre { font-size: 10px; }
}

/* ---------- 標本別カード（展開で人口統計） ---------- */
.spec-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.spec-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised-sm);
    overflow: hidden;
}
.spec-card__head {
    display: grid;
    grid-template-columns: 44px 70px 1fr 220px 60px 22px;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    list-style: none;
}
.spec-card__head::-webkit-details-marker,
.spec-card__head::marker { display: none; }
.spec-card__info {
    min-width: 0;
}
.spec-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.spec-card__title strong {
    font-size: 14px;
    color: var(--text);
}
.spec-card__rate {
    min-width: 0;
}
.spec-card__votes {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
}
.spec-card__arrow {
    font-size: 14px;
    color: var(--text-mute);
    transition: transform 0.22s ease;
    text-align: center;
}
.spec-card[open] .spec-card__arrow { transform: rotate(90deg); }
.spec-card[open] .spec-card__head { background: var(--bg-card-soft); }

.spec-card__body {
    padding: 18px 20px 22px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
.spec-demo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.spec-demo__block h4 {
    margin: 0 0 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--text-mute);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.spec-demo__block h4 span {
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.06em;
}
.spec-demo__row {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 12px;
}
.spec-demo__label {
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spec-demo__val {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    text-align: right;
    font-size: 11px;
}
.spec-demo__row .stats-bar__track {
    height: 6px;
}
.spec-demo__empty {
    margin: 0;
    color: var(--text-mute);
    font-size: 13px;
    text-align: center;
    padding: 18px 0;
}
@media (max-width: 900px) {
    .spec-card__head {
        grid-template-columns: 36px 56px 1fr 130px 50px 22px;
        gap: 10px;
        padding: 12px 14px;
    }
    .spec-card__title strong { font-size: 13px; }
    .spec-demo { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 640px) {
    .spec-card__head {
        grid-template-columns: 30px 48px 1fr 90px 18px;
        gap: 8px;
        padding: 10px 12px;
    }
    .spec-card__votes { display: none; }
    .spec-card__title strong { font-size: 12px; }
    .spec-demo__row { grid-template-columns: 70px 1fr 42px; font-size: 11px; }
}

/* ---------- 限界レベルマトリクス（試験結果） ---------- */
.limit-matrix {
    margin-top: 28px;
}
.lm-wrap {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised-sm);
    padding: 18px 14px;
    overflow-x: auto;
}
.lm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.lm-table th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.14em;
    padding: 8px 4px;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px dashed rgba(0,0,0,0.10);
}
.lm-th-genre { text-align: left !important; padding-left: 12px !important; }
.lm-th-unbreak { color: var(--accent) !important; }
.lm-table td {
    padding: 12px 4px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}
.lm-table tr:last-child td { border-bottom: none; }
.lm-genre {
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
.lm-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.lm-cell {
    min-width: 50px;
    width: 14%;
}
.lm-hit, .lm-unbreak {
    background: rgba(107, 47, 190, 0.05);
}
.lm-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.lm-marker--unbreak {
    background: linear-gradient(135deg, #6B2FBE, #9B59B6);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}
@media (max-width: 640px) {
    .lm-table { font-size: 11px; }
    .lm-table th { font-size: 9px; padding: 6px 2px; }
    .lm-table td { padding: 8px 2px; }
    .lm-genre { font-size: 11px; padding-left: 6px !important; }
    .lm-th-genre { padding-left: 6px !important; }
    .lm-marker { width: 22px; height: 22px; font-size: 10px; }
}

/* ---------- 限界試験（ハード）独立サマリーカード ---------- */
.hard-summary {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.10));
    border-left: 4px solid #E74C3C;
}
.hard-summary__head {
    margin-bottom: 18px;
}
.hard-summary__title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
}
.hard-summary__desc {
    margin: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.6;
}
.hard-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.hard-summary__stat {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--neu-raised-sm);
}
.hard-summary__label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--text-mute);
    margin-bottom: 6px;
}
.hard-summary__num {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #E74C3C;
    line-height: 1;
}
.hard-summary__num span {
    font-size: 14px;
    font-weight: 500;
    margin-left: 2px;
    color: rgba(231, 76, 60, 0.6);
}
.hard-summary__empty {
    margin: 0;
    color: var(--text-mute);
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
}
@media (max-width: 640px) {
    .hard-summary__grid { grid-template-columns: 1fr; }
    .hard-summary__num { font-size: 24px; }
}

/* ---------- ハードモードアンロック CTA（結果画面） ---------- */
.unlock-cta {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.04), rgba(231, 76, 60, 0.10));
    border: 1px solid rgba(231, 76, 60, 0.18);
}
.unlock-cta::before {
    background: radial-gradient(circle, rgba(231, 76, 60, 0.18), transparent 70%);
}
.unlock-cta .stats-cta__tag { color: #E74C3C; }
.unlock-cta__btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #E74C3C, #C0392B) !important;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.30) !important;
}

/* ---------- 結果ページ → 統計ページ CTA ---------- */
/* HTML の hidden 属性が確実に効くよう、特異度を持たせて display:none を確定 */
.stats-cta[hidden] { display: none !important; }

.stats-cta {
    display: block;
    margin-top: 40px;
    padding: 32px 36px 28px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stats-cta::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 180px; height: 180px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
    opacity: 0.55;
}
.stats-cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--neu-raised-lg);
}
.stats-cta__tag {
    margin: 0 0 14px;
}
.stats-cta__head {
    margin: 0 0 22px;
    font-size: clamp(18px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1.45;
    position: relative;
    z-index: 1;
}
.stats-cta__compare {
    margin: 18px 0 22px;
    padding: 12px 0;
    border-top: 1px dashed rgba(0,0,0,0.08);
    border-bottom: 1px dashed rgba(0,0,0,0.08);
    position: relative;
    z-index: 1;
}
/* ─── 横バー比較（YOU vs AVG） ─── */
.stats-cta__bar {
    position: relative;
    padding: 80px 20px 50px;
    /* 上下に十分なスペースを確保（YOU/AVG ラベル用） */
}
.stats-cta__bar-track {
    position: relative;
    height: 10px;
    border-radius: 5px;
    background: var(--bg);
    box-shadow: var(--neu-inset);
    background-image: linear-gradient(90deg,
        rgba(107, 47, 190, 0.20) 0%,
        rgba(107, 47, 190, 0.45) 50%,
        rgba(107, 47, 190, 0.20) 100%);
}
.stats-cta__bar-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.14em;
    padding: 0 2px;
}
.stats-cta__marker {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}
/* YOU マーカー：バーの上、紫アクセント */
.stats-cta__marker--you {
    top: 8px;
    color: var(--accent);
}
.stats-cta__marker--you::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 4px);
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid var(--accent);
    filter: drop-shadow(0 2px 4px rgba(107,47,190,0.30));
}
.stats-cta__marker--you::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 14px);
    width: 2px;
    height: 8px;
    background: var(--accent);
    transform: translateX(-50%);
}
/* AVG マーカー：バーの下、控えめなグレー */
.stats-cta__marker--avg {
    bottom: 22px;
    color: var(--text-dim);
}
.stats-cta__marker--avg::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 4px);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 9px solid rgba(95,100,120,0.55);
}
.stats-cta__marker--avg::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 13px);
    width: 1px;
    height: 6px;
    background: rgba(95,100,120,0.5);
    transform: translateX(-50%);
}
.stats-cta__marker-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: inherit;
    opacity: 0.85;
    white-space: nowrap;
}
.stats-cta__marker-value {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1;
    margin-top: 4px;
    white-space: nowrap;
}
.stats-cta__marker--you .stats-cta__marker-value {
    font-size: 32px;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.stats-cta__marker--avg .stats-cta__marker-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dim);
}
.stats-cta__lead {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 18px;
    line-height: 1.7;
    text-align: center;
    position: relative;
    z-index: 1;
}
.stats-cta__btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    box-shadow: var(--neu-raised-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    z-index: 1;
}
.stats-cta:hover .stats-cta__btn {
    transform: translateX(4px);
    box-shadow: var(--neu-pressed);
}
@media (max-width: 640px) {
    .stats-cta { padding: 24px 22px; }
    .stats-cta__bar { padding: 70px 8px 44px; }
    .stats-cta__marker--you .stats-cta__marker-value { font-size: 26px; }
    .stats-cta__marker--avg .stats-cta__marker-value { font-size: 18px; }
    .stats-cta__marker-label { font-size: 9px; letter-spacing: 0.14em; }
}

/* ---------- SEO セクション（TOP用記事的本文） ---------- */
.seo-about {
    background: rgba(107, 47, 190, 0.03);
    padding: 50px 0;
    margin-top: 24px;
}
.seo-about__lead {
    font-size: clamp(15px, 2vw, 17px);
    line-height: 1.9;
    color: var(--text);
    margin: 0 0 18px;
}
.seo-about__lead strong {
    color: var(--accent);
    font-weight: 700;
}
.seo-about__body p {
    font-size: 14px;
    line-height: 2;
    color: var(--text-dim);
    margin: 0 0 16px;
}
.seo-about__body strong {
    color: var(--text);
    font-weight: 600;
    background: rgba(107, 47, 190, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
}

/* SEO: FAQ */
.seo-faq {
    padding: 40px 0;
}
.seo-faq__item {
    background: var(--bg);
    box-shadow: var(--neu-raised-sm);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}
.seo-faq__item summary {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    list-style: none;
    position: relative;
    padding-right: 48px;
    transition: background 0.15s;
}
.seo-faq__item summary::-webkit-details-marker,
.seo-faq__item summary::marker { display: none; }
.seo-faq__item summary:hover { background: rgba(107,47,190,0.04); }
.seo-faq__item summary::after {
    content: '+';
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
    transition: transform 0.25s;
}
.seo-faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.seo-faq__answer {
    padding: 0 24px 22px;
    font-size: 13.5px;
    line-height: 1.95;
    color: var(--text-dim);
}

/* SEO: 関連キーワード */
.seo-related {
    padding: 30px 0 60px;
}
.seo-related__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 0;
}
.seo-related__term {
    background: var(--bg);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    box-shadow: var(--neu-raised-sm);
    font-family: 'Noto Sans JP', sans-serif;
}

/* ---------- AdSense 広告枠 ---------- */
.ad-slot {
    margin: 28px auto;
    max-width: 100%;
    min-height: 90px;
}
.ad-slot--placeholder {
    background: linear-gradient(135deg, rgba(107,47,190,0.04), rgba(107,47,190,0.10));
    border: 2px dashed rgba(107, 47, 190, 0.30);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.ad-slot__inner { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ad-slot__label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--accent); }
.ad-slot__id { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text); font-weight: 700; }
.ad-slot__note { font-size: 11px; color: var(--text-mute); }

/* ---------- フッターナビ ---------- */
.site-footer__nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}
.site-footer__nav a {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.06em;
}
.site-footer__nav a:hover { color: var(--accent); }

/* ---------- 法務ページ（プライバシー・利用規約） ---------- */
.legal-doc h2 {
    margin: 32px 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(107,47,190,0.18);
}
.legal-doc h3 {
    margin: 22px 0 10px;
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
}
.legal-doc p, .legal-doc li {
    font-size: 13.5px;
    line-height: 1.95;
    color: var(--text-dim);
    margin: 0 0 10px;
}
.legal-doc ul { padding-left: 20px; margin: 10px 0 18px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--accent); text-decoration: underline; }
.legal-doc__footer {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 12px;
    color: var(--text-mute);
}

/* ---------- お問い合わせフォーム ---------- */
.contact-form { background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--neu-raised-sm); padding: 30px; }
.contact-form__field { margin-bottom: 18px; }
.contact-form__field label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-mute);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.contact-form__field label span {
    color: var(--accent);
    margin-left: 6px;
    font-size: 9px;
}
.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--neu-inset);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}
.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    box-shadow: var(--neu-inset), 0 0 0 2px var(--accent-glow);
}
.contact-alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 13px;
}
.contact-alert--ok  { background: rgba(107,47,190,0.10); border-left: 3px solid var(--accent); }
.contact-alert--err { background: rgba(231,76,60,0.10); border-left: 3px solid #E74C3C; color: #C0392B; }

/* （コンテンツ警告/ぼかし機能は撤去済み） */
.card__image-link { position: relative; display: block; }

/* ---------- 記事一覧・記事詳細 ---------- */
.articles-list { display: grid; gap: 16px; }
.article-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-raised-sm);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-2px); box-shadow: var(--neu-raised); }
.article-card__link { display: block; padding: 24px 28px; text-decoration: none; color: inherit; }
.article-card__meta {
    margin: 0 0 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-mute);
    display: flex; gap: 8px;
}
.article-card__title { margin: 0 0 10px; font-size: clamp(16px, 2vw, 19px); font-weight: 700; color: var(--text); line-height: 1.45; }
.article-card__excerpt { margin: 0 0 12px; font-size: 13px; line-height: 1.8; color: var(--text-dim); }
.article-card__more { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; }

/* 記事詳細 */
.article-title { font-size: clamp(24px, 3.6vw, 34px); font-weight: 800; color: var(--text); line-height: 1.4; margin: 12px 0 14px; letter-spacing: 0.02em; }
.article-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-mute); letter-spacing: 0.10em; margin: 0 0 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-meta__sep { opacity: 0.6; }
.article-excerpt { font-size: 15px; line-height: 1.95; color: var(--text-dim); padding: 18px 22px; background: rgba(107,47,190,0.04); border-left: 3px solid var(--accent); border-radius: 4px; margin: 0 0 32px; }
.article-body h2 { margin: 36px 0 14px; font-size: clamp(20px, 2.6vw, 24px); font-weight: 800; color: var(--text); padding-bottom: 8px; border-bottom: 2px solid rgba(107,47,190,0.18); }
.article-body h3 { margin: 26px 0 12px; font-size: 17px; font-weight: 700; color: var(--accent); }
.article-body p { margin: 0 0 16px; font-size: 14.5px; line-height: 2; color: var(--text-dim); }
.article-body strong { color: var(--text); font-weight: 700; background: rgba(107,47,190,0.08); padding: 1px 5px; border-radius: 3px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 16px 0 20px; }
.article-body li { margin-bottom: 8px; font-size: 14px; line-height: 1.9; color: var(--text-dim); }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body em { color: var(--text-mute); font-size: 13px; font-style: italic; }
.article-cta-wrap { text-align: center; margin: 32px 0; }
.article-cta {
    display: inline-block; padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff !important; text-decoration: none !important;
    border-radius: var(--radius-pill);
    font-weight: 700; font-size: 14px; letter-spacing: 0.06em;
    box-shadow: 0 10px 24px rgba(107,47,190,0.30);
}
.article-cta:hover { transform: translateY(-2px); }
.article-related { margin-top: 60px; padding-top: 30px; border-top: 1px dashed rgba(0,0,0,0.10); }
.article-final-cta {
    margin-top: 50px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(107,47,190,0.06), rgba(107,47,190,0.16));
    border-radius: var(--radius-lg);
    text-align: center;
}
.article-final-cta p { margin: 0 0 14px; font-size: 14px; color: var(--text); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg);
    border: none;
    color: var(--text);
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    letter-spacing: 0.06em;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 100;
    box-shadow: var(--neu-raised-lg);
}

.toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--border-soft);
    padding: 40px 0;
    color: var(--text-mute);
    font-size: 12px;
    text-align: center;
    letter-spacing: 0.08em;
}

.site-footer a { color: var(--text-dim); }

/* ---------- Utilities ---------- */
.text-dim { color: var(--text-dim); }
.text-mute { color: var(--text-mute); }
.mono { font-family: 'Space Grotesk', monospace; letter-spacing: 0.08em; }

/* ---------- Empty State ---------- */
.empty {
    padding: 80px 24px;
    text-align: center;
    color: var(--text-dim);
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-inset);
}

/* ---------- Responsive（全体） ---------- */
@media (max-width: 860px) {
    /* タブレット以下：セクションの余白を縮める */
    .section { padding: 40px 0; }
    .hero { padding: 56px 0 40px; }
    .hero__title { letter-spacing: 0.18em; text-indent: 0.18em; }
}

@media (max-width: 640px) {
    .container { padding: 0 14px; }
    .section { padding: 32px 0; }
    .hero { padding: 36px 0 28px; }
    .hero__tagline { font-size: 10px; margin-bottom: 18px; }
    .hero__title {
        font-size: clamp(24px, 7vw, 36px);
        letter-spacing: 0.16em;
        text-indent: 0.16em;
    }
    .hero__divider { margin: 18px 0 14px; gap: 10px; }
    .hero__divider hr { width: 36px; }
    .hero__subtitle { font-size: clamp(11px, 3.2vw, 14px); margin: 0 auto 6px; }
    .hero__lead { font-size: 13px; }
    .grid { grid-template-columns: 1fr; gap: 18px; }
    .section__head { flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 12px; margin-bottom: 24px; }
    .section__title { font-size: 18px; }
    /* フィルタは折返し */
    .filter-row { gap: 6px; }
    .filter-chip { padding: 7px 12px; font-size: 11px; }
    /* テーブル系：横スクロール許可 */
    table { font-size: 12px; }
    table th, table td { padding: 8px 6px !important; }
    /* Featured Specimen */
    .featured-specimen { padding: 12px 0 32px; }
    .featured-specimen__panel { padding: 18px; gap: 18px; }
    .featured-specimen__title { font-size: clamp(22px, 6vw, 28px); }
    .featured-specimen__data { grid-template-columns: 80px 1fr; padding: 14px 0; row-gap: 8px; }
    .featured-specimen__data dd { font-size: 12px; }
    /* Diag CTA フル版 */
    .diag-cta { padding: 24px 20px; }
    .diag-cta__title { font-size: clamp(18px, 5.5vw, 24px); }
    .diag-cta__desc { font-size: 12px; }
    .diag-cta__btn { width: 100%; justify-content: center; padding: 14px 20px; }
    /* マーキー：少しコンパクト */
    .marquee__item { flex: 0 0 200px; height: 150px; }
    /* Community */
    .community-form { padding: 18px 16px; }
    .thread { padding: 16px 18px; }
    .thread__head { gap: 8px; }
    .thread__no { margin-left: 0; }
    .thread__body { font-size: 13px; }
    .thread__replies { padding-left: 12px; }
    .reply { padding: 10px 12px; }
    /* Image page detail */
    .image-detail { grid-template-columns: 1fr !important; }
    .image-genre-tag { padding: 12px 14px; gap: 10px; }
    /* Ranking King cards */
    .genre-kings { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .nav { gap: 6px 10px; }
    .nav a { font-size: 10px; }
    .filter-chip { padding: 6px 10px; font-size: 10px; }
    .marquee__item { flex: 0 0 180px; height: 135px; }
}

/* =============================================================
   HERO 直下：集合体恐怖症診断カード（M4a 採用版）
   - ライトニューモフィズム × 薄い紫グラデ
   - Reggae One タイトル（重厚インパクト）
   - 鋭角コーナー（12px）+ 強いエッジ
   - 7ジャンル代表サムネの横スクロールマーキー
   - 円形ニューモソケット風サムネ
   - ニューモピル形ジャンルラベル
   - ピル型 A/B チップ + 紫グラデCTA
   ============================================================= */
.dgcard {
    background:
        linear-gradient(135deg,
            rgba(190, 137, 216, 0.06) 0%,
            rgba(155, 89, 182, 0.10) 50%,
            rgba(123, 47, 190, 0.13) 100%),
        var(--bg);
    border-radius: 12px;
    padding: 36px 36px 32px;
    color: var(--text);
    text-align: center;
    box-shadow:
        -22px -22px 50px var(--shadow-light),
         26px  26px 60px var(--shadow-dark),
         0 0 0 1px rgba(155, 89, 182, 0.10),
        inset 0  2px 0 rgba(255, 255, 255, 0.95),
        inset 0  1px 8px rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(123, 47, 190, 0.08),
        inset 0 -1px 6px rgba(123, 47, 190, 0.06),
        inset  2px 0 6px rgba(255, 255, 255, 0.45),
        inset -2px 0 6px rgba(255, 255, 255, 0.45);
    overflow: hidden;
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.dgcard__head {
    position: relative;
    margin: 0 0 10px;
    font-family: 'Reggae One', 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(28px, 4.5vw, 42px);
    letter-spacing: 0.16em;
    line-height: 1.2;
    color: var(--text);
    text-shadow:
        0 1px 1px rgba(255, 255, 255, 0.9),
        0 0 24px rgba(155, 89, 182, 0.18);
}

.dgcard__sub {
    position: relative;
    margin: 0 0 14px;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 600;
}
.dgcard__sub::before,
.dgcard__sub::after {
    content: "";
    display: inline-block;
    width: 22px;
    height: 1px;
    vertical-align: middle;
    margin: 0 10px 4px;
    background: var(--accent-light);
}

/* --- マーキー --- */
.dgcard__mq-wrap {
    position: relative;
    margin: 14px -36px 16px;
    padding: 8px 0;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.dgcard__mq {
    display: flex;
    gap: 18px;
    width: max-content;
    align-items: flex-start;
    animation: dgcardScroll 22s linear infinite;
}
.dgcard:hover .dgcard__mq { animation-play-state: paused; }
.dgcard__mq-item {
    position: relative;
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.dgcard__mq-thumb {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--bg);
    box-shadow:
        0 0 0 1px rgba(155, 89, 182, 0.18),
        -2px -2px 6px var(--shadow-light),
         4px  4px 10px var(--shadow-dark);
}
.dgcard__mq-label {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    z-index: 2;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow:
        -1px -1px 3px var(--shadow-light),
         2px  2px 5px var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
@keyframes dgcardScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- 選択肢カード（2分割／ピル型ニューモ） --- */
.dgcard__choice {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 280px;
    margin: 4px auto 12px;
}
.dgcard__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    background: var(--bg);
    border: none;
    text-align: center;
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark),
        inset 0  1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(123, 47, 190, 0.05);
}
.dgcard__pill--zowa  { color: #C92340; }
.dgcard__pill--brave { color: #1F7672; }

.dgcard__note {
    position: relative;
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--text-mute);
    line-height: 1.6;
}

/* --- CTA ボタン（紫グラデ・既存維持） --- */
.dgcard__btn {
    position: relative;
    display: inline-block;
    padding: 14px 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7B2FBE, #9B59B6);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.05em;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(123,47,190,0.45);
    transition: transform .2s ease, box-shadow .2s ease;
}
.dgcard__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(123,47,190,0.55);
    color: #fff;
}

/* --- レスポンシブ --- */
@media (max-width: 560px) {
    .dgcard { padding: 28px 22px 26px; border-radius: 10px; }
    .dgcard__head { font-size: clamp(24px, 7vw, 32px); letter-spacing: 0.12em; }
    .dgcard__mq-wrap { margin: 12px -22px; }
    .dgcard__mq { gap: 14px; }
    .dgcard__mq-item { width: 80px; height: 80px; }
    .dgcard__mq-thumb { width: 80px; height: 80px; border-width: 2.5px; }
    .dgcard__mq-label { font-size: 9px; padding: 2px 7px; }
    .dgcard__pill { padding: 9px 16px; font-size: 13px; }
    .dgcard__btn { padding: 12px 28px; font-size: 14px; }
}

/* =============================================================
   標本コメント（観察メモ）
   ============================================================= */
.img-comments {
    max-width: 760px;
}
.img-comments__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    margin-left: 10px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    vertical-align: middle;
    box-shadow:
        inset 2px 2px 5px var(--shadow-dark),
        inset -2px -2px 5px var(--shadow-light);
}
.img-comments__empty {
    color: var(--text-mute);
    font-size: 13px;
    padding: 28px 0 8px;
}
.img-comments__list {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.img-comment {
    background: var(--bg);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow:
        -4px -4px 10px var(--shadow-light),
         5px  5px 12px var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.img-comment__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.img-comment__handle {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}
.img-comment__ipid {
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.06em;
}
.img-comment__time {
    font-size: 10px;
    color: var(--text-mute);
    margin-left: auto;
}
.img-comment__body {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    word-break: break-word;
}

/* 投稿フォーム */
.img-comments__form {
    margin-top: 28px;
    background: var(--bg);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow:
        inset 4px 4px 10px var(--shadow-dark),
        inset -4px -4px 10px var(--shadow-light);
}
.img-comments__form-row { margin-bottom: 12px; }
.img-comments__form-row input[type="text"],
.img-comments__form-row textarea {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 12px 16px;
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark);
    outline: none;
    resize: vertical;
}
.img-comments__form-row input[type="text"]:focus,
.img-comments__form-row textarea:focus {
    box-shadow:
        -3px -3px 8px var(--shadow-light),
         4px  4px 10px var(--shadow-dark),
        0 0 0 2px rgba(123, 47, 190, 0.25);
}
.img-comments__form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.img-comments__note {
    font-size: 11px;
    color: var(--text-mute);
}

/* =============================================================
   ページ下部：診断CTAバナー（dgcta／横長・ニューモ + dgcard アクセント）
   ============================================================= */
.dgcta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
    padding: 36px 40px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--neu-raised-lg);
}
/* コーナーブラケット（既存 diag-cta の意匠を継承） */
.dgcta::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 36px; height: 36px;
    border: 1px solid var(--accent);
    border-right: none; border-bottom: none;
    pointer-events: none;
    z-index: 2;
}
.dgcta::after {
    content: "";
    position: absolute;
    bottom: -1px; right: -1px;
    width: 36px; height: 36px;
    border: 1px solid var(--accent);
    border-left: none; border-top: none;
    pointer-events: none;
    z-index: 2;
}

.dgcta__copy { position: relative; min-width: 0; z-index: 1; }

.dgcta__tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--accent-light);
    text-transform: uppercase;
    margin: 0 0 10px;
}

.dgcta__title {
    margin: 0 0 12px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(22px, 3.2vw, 32px);
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: 0.14em;
    color: var(--text);
}
.dgcta__title em {
    font-style: normal;
    background: linear-gradient(90deg, #7B2FBE, #BE89D8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dgcta__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-dim);
}

.dgcta__btn {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    padding: 16px 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7B2FBE, #9B59B6);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 14px 30px rgba(123, 47, 190, 0.45);
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 1;
}
.dgcta__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(123, 47, 190, 0.55);
    color: #fff;
}

/* レスポンシブ：狭画面では縦積み */
@media (max-width: 720px) {
    .dgcta {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 28px 24px;
        gap: 20px;
    }
    .dgcta__btn { justify-self: center; padding: 14px 32px; font-size: 14px; }
    .dgcta__desc br { display: none; }
}
