:root {
    --ink: #272727;
    --sub: #929292;
    --line: #e9e9e9;
    --rose: #da5777;
    font-family: Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    color: var(--ink);
    background: #fff;
    font-synthesis: none
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: #fff
}

button,
select {
    font: inherit
}

button {
    cursor: pointer
}

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

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px
}

button:disabled {
    opacity: .3;
    cursor: default
}

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line)
}

.header-inner {
    max-width: 1376px;
    margin: auto;
    min-height: 93px;
    padding: 18px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 7px
}

.brand-name {
    font-weight: 780;
    font-size: 21px;
    letter-spacing: .075em;
    line-height: 1.1
}

.brand-thin {
    font-weight: 400
}

.brand-sub {
    font-size: 10px;
    color: #aaa;
    letter-spacing: .22em
}

.head-actions {
    display: flex;
    gap: 28px;
    align-items: center
}

.header-label {
    font-size: 10px;
    letter-spacing: .19em;
    color: #aaa
}

.language {
    background: white;
    border: 1px solid #e2e2e2;
    border-radius: 24px;
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: .09em;
    color: #333
}

.language span {
    color: #bbb;
    padding: 0 3px
}

main {
    max-width: 1376px;
    padding: 0 36px 86px;
    margin: auto
}

.hero {
    padding: 77px 0 43px;
    border-bottom: 1px solid var(--line)
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .20em;
    display: flex;
    align-items: center;
    gap: 9px
}

.tiny-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc7d92;
    display: inline-block
}

.muted {
    color: #c6c6c6;
    margin: 0 5px
}

.hero h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(43px, 6.5vw, 91px);
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -.055em;
    margin: 29px 0
}

.hero-bottom {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px
}

.hero-bottom p {
    margin: 0;
    color: #777;
    font-size: 14px;
    line-height: 1.8;
    max-width: 580px
}

.work-count {
    color: #888;
    font-size: 11px;
    letter-spacing: .12em;
    white-space: nowrap
}

.toolbar {
    padding: 31px 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.chip {
    border: 1px solid var(--line);
    background: #fff;
    color: #606060;
    border-radius: 25px;
    padding: 10px 18px;
    font-size: 12px;
    letter-spacing: .045em
}

.chip.active {
    background: #292929;
    border-color: #292929;
    color: white
}

.sort-zone {
    display: flex;
    align-items: center;
    gap: 10px
}

.sort-zone label {
    font-size: 10px;
    letter-spacing: .13em;
    color: #999
}

.sort-zone select {
    background: #fff;
    border: 1px solid var(--line);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 122px;
    color: #444
}

.character-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 13px;
    margin: 0 0 27px
}

.character-btn {
    border: 0;
    background: none;
    padding: 5px 1px;
    color: #999;
    font-size: 12px
}

.character-btn.active {
    font-weight: 700;
    color: #222;
    text-decoration: underline;
    text-decoration-color: #db728a;
    text-underline-offset: 6px
}

.gallery {
    columns: 4 230px;
    column-gap: 19px
}

.tile {
    width: 100%;
    break-inside: avoid;
    display: inline-block;
    margin: 0 0 25px
}

.artwork-button {
    border: none;
    padding: 0;
    display: block;
    width: 100%;
    position: relative;
    aspect-ratio: var(--aspect);
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 3px
}

.artwork-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block
}

.artwork-button:hover .mock-image {
    transform: scale(1.025)
}

.mock-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    transition: transform .35s
}

.mock-image::before {
    content: "";
    width: 125%;
    height: 70%;
    border: 1px solid rgba(95, 95, 95, .13);
    border-radius: 50%;
    position: absolute;
    transform: rotate(-28deg)
}

.mock-image::after {
    content: "";
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(95, 95, 95, .13);
    position: absolute;
    top: 17%;
    right: -14%
}

.mock-tag {
    font-size: 10px;
    letter-spacing: .17em;
    color: #777;
    opacity: .8;
    z-index: 1;
    margin-bottom: 15px
}

.mock-mark {
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 61px);
    font-weight: 400;
    opacity: .25;
    z-index: 1
}

.mock-label {
    font-size: 10px;
    letter-spacing: .22em;
    position: absolute;
    bottom: 21px;
    color: #777;
    z-index: 1
}

.artwork-button:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, .07)
}

.tile-caption {
    margin-top: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px
}

.tile-name {
    min-width: 0
}

.tile-name strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em
}

.tile-name small {
    display: block;
    margin-top: 5px;
    color: #aaa;
    font-size: 10px;
    letter-spacing: .085em
}

.like-button {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 6px 3px;
    background: none;
    border: 0;
    color: #8e8e8e;
    font-size: 12px;
    min-width: 41px
}

.like-button.liked {
    color: var(--rose)
}

.heart-svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none
}

.liked .heart-svg {
    fill: currentColor
}

.empty-state {
    padding: 70px 10px;
    text-align: center;
    color: #aaa
}

.gallery-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-top: 58px
}

.gallery-end .rule {
    height: 1px;
    background: var(--line);
    flex: 1
}

.gallery-end #endnote {
    font-size: 10px;
    letter-spacing: .21em;
    color: #aaa;
    text-align: center
}

.demo-notice {
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
    color: #aaa;
    margin: 27px auto 0
}

.footer {
    border-top: 1px solid var(--line)
}

.footer-inner {
    max-width: 1376px;
    padding: 33px 36px;
    margin: auto;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    color: #aaa;
    font-size: 11px;
    line-height: 1.6
}

.footer-inner strong {
    color: #555;
    letter-spacing: .1em
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #fff;
    flex-direction: column
}

.lightbox.open {
    display: flex
}

.lightbox-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 28px;
    border-bottom: 1px solid var(--line);
    min-height: 69px;
    gap: 10px
}

.light-title {
    display: flex;
    flex-direction: column;
    gap: 6px
}

#lightTitle {
    font-weight: 700;
    font-size: 14px
}

.light-subtitle {
    font-size: 11px;
    color: #999
}

.icon-btn {
    border: 0;
    background: none;
    padding: 8px 11px;
    font-size: 21px;
    color: #555
}

.lightbox-stage {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #fafafa
}

.lightbox-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y
}

.lightbox-image-wrap img {
    width: auto;
    height: auto;
    max-width: 87%;
    max-height: 95%;
    object-fit: contain;
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform .15s ease
}

.lightbox-image-wrap img.zoomed {
    transform: scale(2);
    cursor: zoom-out
}

.lightbox-image-wrap .mock-image {
    position: relative;
    width: min(55%, 450px);
    height: 82%;
    max-height: 690px
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: #ffffffd4;
    border: 1px solid #eee;
    border-radius: 50%;
    height: 42px;
    width: 42px;
    font-size: 30px;
    line-height: 30px;
    color: #555
}

.arrow-left {
    left: 21px
}

.arrow-right {
    right: 21px
}

.lightbox-bottom {
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 65px;
    border-top: 1px solid var(--line)
}

.like-large {
    font-size: 13px
}

.like-large .heart-svg {
    height: 23px;
    width: 23px
}

.position {
    font-size: 11px;
    letter-spacing: .12em;
    color: #aaa
}

.share-link {
    border: 0;
    background: none;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: #555
}

@media(max-width:1000px) {
    .gallery {
        columns: 3 210px
    }

    .header-inner,
    main,
    .footer-inner {
        padding-left: 26px;
        padding-right: 26px
    }

    .header-label {
        display: none
    }
}

@media(max-width:650px) {
    .header-inner {
        padding: 15px 16px;
        min-height: 72px
    }

    .brand-name {
        font-size: 15px
    }

    .brand-sub {
        font-size: 8px
    }

    .language {
        font-size: 11px;
        padding: 9px
    }

    .hero {
        padding: 47px 0 31px
    }

    .hero h1 {
        font-size: 49px;
        margin: 25px 0
    }

    .hero-bottom {
        align-items: start;
        gap: 10px
    }

    .hero-bottom p {
        font-size: 12px
    }

    .work-count {
        font-size: 9px;
        margin-top: 4px
    }

    .eyebrow {
        font-size: 9px
    }

    .gallery {
        columns: 2;
        column-gap: 11px
    }

    .tile {
        margin-bottom: 20px
    }

    .tile-name strong {
        font-size: 12px
    }

    .tile-name small {
        font-size: 9px
    }

    .artwork-button {
        border-radius: 2px
    }

    .mock-mark {
        font-size: 32px
    }

    .mock-label {
        font-size: 8px
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding-top: 23px
    }

    .sort-zone {
        align-self: flex-end
    }

    .chip {
        padding: 9px 13px;
        font-size: 11px
    }

    .character-filters {
        gap: 12px;
        margin-top: 0
    }

    .character-btn {
        font-size: 11px
    }

    .footer-inner {
        flex-direction: column;
        align-items: start;
        gap: 10px
    }

    .lightbox-top {
        padding: 9px 16px
    }

    .lightbox-bottom {
        padding: 9px 14px
    }

    .arrow-left {
        left: 5px
    }

    .arrow-right {
        right: 5px
    }

    .arrow {
        height: 34px;
        width: 34px;
        font-size: 24px
    }

    .lightbox-image-wrap img {
        max-width: 93%
    }

    .lightbox-image-wrap .mock-image {
        width: 62%;
        height: 65%
    }

    main {
        padding: 0 15px 50px
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

#originalImage {
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transition: none;
    will-change: transform;
}

#albumViewHeader[hidden] {
    display: none;
}

#albumViewHeader {
    padding: 28px 0 18px;
    border-top: 1px solid var(--line);
}

#albumBack {
    border: none;
    background: none;
    color: #777;
    font-size: 12px;
    padding: 8px 0;
}

#albumBack:hover {
    color: #222;
}

#albumViewTitle {
    font-size: 24px;
    font-weight: 600;
    margin: 15px 0 8px;
}

#albumViewCount {
    color: #999;
    font-size: 12px;
    margin: 0 0 20px;
}

.hero[hidden] {
    display: none;
}

/* TOPページ：ロゴの中央配置 */
.header-inner {
    position: relative;
    justify-content: center;
}

.brand {
    align-items: center;
    text-align: center;
}

.head-actions {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 650px) {
    .head-actions {
        right: 16px;
    }
}

/* TOPページ：日本語ロゴ */
.brand-name {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: clamp(24px, 3.5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.25;
}

.brand-sub:empty {
    display: none;
}

@media (max-width: 650px) {
    .brand-name {
        font-size: clamp(17px, 5vw, 25px);
    }
}

/* TOPページ：ALBUMS見出しを非表示 */
#albumHeading {
    display: none;
}

/* キャラクターフィルター */
.character-filters {
    gap: 12px;
}

.character-btn {
    border: 1px solid #d5d5d5;
    border-radius: 30px;
    background: #fff;
    color: #222;
    padding: 9px 20px;
    font-size: 13px;
    text-decoration: none;
    min-width: 76px;
}

.character-btn.active {
    background: #343434;
    border-color: #343434;
    color: #fff;
    text-decoration: none;
}

.character-placeholder:disabled {
    opacity: 1;
    color: #555;
    cursor: default;
}

@media (max-width: 650px) {
    .character-filters {
        gap: 8px;
    }

    .character-btn {
        padding: 8px 12px;
        min-width: 65px;
        font-size: 11px;
    }
}

/* 作品カードのいいね・閲覧数 */
.artwork-stats {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.view-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
    font-size: 12px;
    white-space: nowrap;
}

.view-icon {
    font-size: 12px;
    line-height: 1;
}

.view-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* 拡大画面のいいね・閲覧数 */
.lightbox-stats {
    display: inline-flex;
    align-items: center;
    gap: 18px;
}

.lightbox-stats .view-counter {
    font-size: 13px;
}

/* ========================================
   TOPページ：アルバム専用ギャラリー
   ======================================== */

#albumGallery {
    columns: 4 220px;
    column-gap: 14px;
}

#albumGallery .tile {
    display: inline-block;
    width: 100%;
    margin: 0 0 14px;
    break-inside: avoid;
}

#albumGallery .artwork-button {
    border-radius: 14px;
    overflow: hidden;
}

#albumGallery .artwork-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 参考デザインに合わせて表紙の下の文字を非表示 */
#albumGallery .tile-name {
    display: none;
}

/* タブレット */
@media (max-width: 1000px) {
    #albumGallery {
        columns: 3 190px;
        column-gap: 12px;
    }

    #albumGallery .tile {
        margin-bottom: 12px;
    }
}

/* スマートフォン */
@media (max-width: 650px) {
    #albumGallery {
        columns: 2;
        column-gap: 9px;
    }

    #albumGallery .tile {
        margin-bottom: 9px;
    }

    #albumGallery .artwork-button {
        border-radius: 10px;
    }
}

/* ヘッダーの「ファンアートアーカイブ」を非表示 */
.header-label {
    display: none;
}

/* TOPページ：アルバムを横並びのグリッドにする */
#albumGallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

#albumGallery .tile {
    display: block;
    margin: 0;
    min-width: 0;
}

/* タブレット */
@media (max-width: 1000px) {
    #albumGallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

/* スマートフォン */
@media (max-width: 650px) {
    #albumGallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
}

/* サイトロゴ：和風の筆文字 */
.brand-name {
    font-family: "Yuji Mai", "Yu Mincho", serif;
    font-weight: 400;
}

/* ========================================
   サイトロゴ：透過PNG画像
   ======================================== */

.brand-logo {
    display: block;
    width: clamp(252px, 41.4vw, 558px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* スマートフォン */
@media (max-width: 650px) {
    .brand-logo {
        width: min(68vw, 320px);
        height: auto;
    }
}

/* ========================================
   フッター：このサイトの説明
   ======================================== */

.footer {
    padding: 26px 0 34px;
    border-top: 1px solid #e8e8e8;
}

.footer .footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.site-about {
    width: 100%;
    text-align: center;
    color: #666;
}

.site-about summary {
    display: inline-block;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 8px 12px;
}

.site-about summary:hover {
    color: #222;
}

.site-about p {
    max-width: 560px;
    margin: 15px auto 0;
    font-size: 13px;
    line-height: 2;
    color: #666;
}

/* スマートフォン */
@media (max-width: 650px) {
    .footer {
        padding: 20px 0 28px;
    }

    .site-about summary {
        font-size: 12px;
    }

    .site-about p {
        font-size: 12px;
    }
}

/* ========================================
   ページ全体：フッターを画面下部に配置
   ======================================== */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

main {
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* ========================================
   ページ全体：フッターを画面下部に配置
   ======================================== */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

main {
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* ヘッダーをスクロールに合わせて移動させる */
.site-header {
    position: static;
    top: auto;
}

/* ========================================
   TOPページ：アルバム・モザイクギャラリー
   ======================================== */


/* PC：高さに応じたモザイク配置 */
#albumGallery {
    display: grid;
    columns: auto;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 4px;
    grid-auto-flow: dense;
    gap: 12px;
    align-items: start;
}

#albumGallery>.tile:nth-child(n) {
    grid-column: span 3;
    grid-row-end: auto;
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* 3枚目を大きく表示 */
#albumGallery>.tile:nth-child(8n + 3) {
    grid-column: span 6;
}

/* 7・8枚目に変化をつける */
#albumGallery>.tile:nth-child(8n + 7) {
    grid-column: span 5;
}

#albumGallery>.tile:nth-child(8n + 8) {
    grid-column: span 4;
}

/* タブレット */
@media (max-width: 1000px) {
    #albumGallery {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 10px;
    }

    #albumGallery>.tile:nth-child(n) {
        grid-column: span 2;
    }

    #albumGallery>.tile:nth-child(8n + 3) {
        grid-column: span 4;
    }
}

/* スマートフォン */
@media (max-width: 650px) {
    #albumGallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    #albumGallery>.tile:nth-child(n) {
        grid-column: span 1;
    }
}

/* スマートフォン：ロゴを左、言語切替を右に配置 */
@media (max-width: 650px) {
    .header-inner {
        justify-content: space-between;
        min-height: 0;
        padding: 12px 14px;
        gap: 10px;
    }

    .header-inner .brand {
        flex: 1 1 auto;
        min-width: 0;
        align-items: flex-start;
        text-align: left;
    }


    .header-inner .brand-logo {
        width: 90%;
        max-width: 252px;
        height: auto;
    }


    .header-inner .head-actions {
        position: static;
        top: auto;
        right: auto;
        transform: none;
        flex: 0 0 auto;
        margin-left: auto;
    }
}

/* PC・タブレット：ロゴを左側に配置 */
@media (min-width: 651px) {
    .header-inner {
        justify-content: flex-start;
    }

    .header-inner .brand {
        align-items: flex-start;
        text-align: left;
    }
}

/* TOP：アルバム表紙のモザイク表示比率 */

/* 1・2枚目：縦長 */
#albumGallery>.tile:nth-child(8n + 1) .artwork-button,
#albumGallery>.tile:nth-child(8n + 2) .artwork-button {
    aspect-ratio: 3 / 4;
}

/* 3枚目：大きな横長 */
#albumGallery>.tile:nth-child(8n + 3) .artwork-button {
    aspect-ratio: 5 / 4;
}

/* 4・6枚目：やや縦長 */
#albumGallery>.tile:nth-child(8n + 4) .artwork-button,
#albumGallery>.tile:nth-child(8n + 6) .artwork-button {
    aspect-ratio: 4 / 5;
}

/* 5枚目：正方形 */
#albumGallery>.tile:nth-child(8n + 5) .artwork-button {
    aspect-ratio: 1 / 1;
}

/* 7・8枚目以降の変化 */
#albumGallery>.tile:nth-child(8n + 7) .artwork-button {
    aspect-ratio: 4 / 3;
}

#albumGallery>.tile:nth-child(8n + 8) .artwork-button {
    aspect-ratio: 3 / 4;
}

/* 顔をなるべく残して切り抜く */
#albumGallery .artwork-button img {
    object-fit: cover;
    object-position: center top;
}

/* PC：6枚目の表紙を横に広げて空白を減らす */
@media (min-width: 1001px) {
    #albumGallery>.tile:nth-child(8n + 6) {
        grid-column: span 6;
    }

    #albumGallery>.tile:nth-child(8n + 6) .artwork-button {
        aspect-ratio: 3 / 2;
    }
}

/* PC：4・5枚目を縦長にして下端を揃える */
@media (min-width: 1001px) {

    #albumGallery>.tile:nth-child(8n + 4) .artwork-button,
    #albumGallery>.tile:nth-child(8n + 5) .artwork-button {
        aspect-ratio: 3 / 5;
    }
}

/* ========================================
   TOP：自動モザイク配置
   ======================================== */

/* PC：JavaScriptから表示幅と比率を受け取る */
#albumGallery.auto-mosaic>.tile:nth-child(n) {
    grid-column: span var(--mosaic-cols, 3);
}

#albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button {
    aspect-ratio: var(--mosaic-ratio, 3 / 4);
    clip-path: var(--mosaic-clip, polygon(0 0, 100% 0, 100% 100%, 0 100%));
    border-radius: 0;
    overflow: hidden;
}

#albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* 自動モザイク：表紙の角を丸くする */
#albumGallery.auto-mosaic .artwork-button {
    border-radius: 22px;
    overflow: hidden;
}

#albumGallery.auto-mosaic .artwork-button img {
    object-fit: cover;
    object-position: center top;
}

/* タブレット：3列 */
@media (min-width: 651px) and (max-width: 1000px) {
    #albumGallery.auto-mosaic>.tile:nth-child(n) {
        grid-column: span 2;
    }
}

/* スマートフォン：2列 */
@media (max-width: 650px) {
    #albumGallery.auto-mosaic>.tile:nth-child(n) {
        grid-column: span 1;
    }

    #albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button {
        aspect-ratio: 3 / 4;
    }
}

/* スマホ・タブレットでは台形を解除する */
@media (max-width: 1000px) {
    #albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button {
        clip-path: none;
        border-radius: 14px;
    }
}

/* ========================================
   TOP：シンプルなメイソンリー
   ======================================== */

#albumGallery {
    display: block;
    columns: 4;
    column-gap: 16px;
}

#albumGallery.auto-mosaic>.tile:nth-child(n) {
    display: inline-block;
    width: 100%;
    margin: 0 0 16px;
    break-inside: avoid;
}

/* 元画像の縦横比を維持する */
#albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button {
    aspect-ratio: var(--aspect, 3 / 4);
    clip-path: none;
    border-radius: 18px;
    overflow: hidden;
}

#albumGallery.auto-mosaic .artwork-button img {
    object-fit: contain;
    object-position: center;
}

/* タブレット */
@media (max-width: 1000px) {
    #albumGallery {
        columns: 3;
        column-gap: 12px;
    }

    #albumGallery.auto-mosaic>.tile:nth-child(n) {
        margin-bottom: 12px;
    }
}

/* スマートフォン */
@media (max-width: 650px) {
    #albumGallery {
        columns: 2;
        column-gap: 10px;
    }

    #albumGallery.auto-mosaic>.tile:nth-child(n) {
        margin-bottom: 10px;
    }

    #albumGallery.auto-mosaic>.tile:nth-child(n) .artwork-button {
        aspect-ratio: var(--aspect, 3 / 4);
        border-radius: 14px;
    }
}

/* 英語ロゴ：ヘッダーの高さを日本語版に合わせる */
html[lang="en"] .header-inner .brand-logo {
    width: 360px;
    max-width: 100%;
    height: auto;
}

/* スマートフォン */
@media (max-width: 650px) {
    html[lang="en"] .header-inner .brand-logo {
        width: 210px;
        max-width: 100%;
        height: auto;
    }
}

/* 日本語ロゴ：英語版と高さをそろえる */

html[lang="ja"] .header-inner .brand-logo {
    width: auto;
    height: 90px;
    max-width: 100%;
    transform: scale(1.40);
    transform-origin: left center;
}


/* スマートフォン */
@media (max-width: 650px) {
    html[lang="ja"] .header-inner .brand-logo {
        width: auto;
        height: 53px;
        max-width: 100%;
    }
}

/* ========================================
   TOP：横方向優先メイソンリー
   ======================================== */

#albumGallery.auto-mosaic {
    display: grid;
    columns: initial;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 4px;
    grid-auto-flow: row dense;
    column-gap: 16px;
    row-gap: 12px;
    align-items: start;
}

#albumGallery.auto-mosaic>.tile:nth-child(n) {
    display: block;
    width: 100%;
    margin: 0;
    grid-column: auto;
    break-inside: auto;
}

/* タブレット：3列 */
@media (max-width: 1000px) {
    #albumGallery.auto-mosaic {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

/* スマートフォン：2列 */
@media (max-width: 650px) {
    #albumGallery.auto-mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* 新作・NEWバッジ */
.artwork-button {
    position: relative;
}


/* 新作・NEW：クリームゴールド */
.new-artwork-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 5px 9px;
    border-radius: 999px;

    background: linear-gradient(180deg,
            #FFFDF5 0%,
            #F2E6CF 65%,
            #E8D1A6 100%);

    color: #473925;
    border: 1px solid #C5A16A;

    box-shadow:
        0 2px 7px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    white-space: nowrap;

    pointer-events: none;
}

/* 左右の小さなゴールド装飾 */
.new-artwork-badge::before,
.new-artwork-badge::after {
    content: "✦";
    color: #BA8B3C;
    font-size: 8px;
    line-height: 1;
}

/* ========================================
   作品拡大画面：画像を最大表示
   ======================================== */

.lightbox.open {
    display: block;
}

/* 上部バーを廃止し、閉じるボタンだけ残す */
.lightbox-top {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    min-height: 0;
    padding: 10px;
    border: none;
}

.light-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#close {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

/* 画面全体を画像表示領域にする */
.lightbox-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

/* 画像の実際の大きさに合わせる枠 */
.lightbox-image-frame {
    position: relative;
    flex: none;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.lightbox-image-wrap {
    display: block;
    width: auto;
    height: auto;
    overflow: hidden;
}

/* 元画像の縦横比を完全維持 */
.lightbox-image-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    object-fit: contain;
}

/* 画像内の下部に操作アイコンを重ねる */
.lightbox-bottom {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

.lightbox-bottom>* {
    pointer-events: auto;
}

/* 左下：リンクコピー */
#copyLink {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 8px;
    font-size: 11px;
    text-decoration: none;
}

/* 右下：いいね・閲覧数 */
.lightbox-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
}

/* 画面下中央：枚数表示 */
#lightPosition {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
}

/* スマートフォン */
@media (max-width: 650px) {
    .lightbox-bottom {
        bottom: 6px;
        left: 6px;
        right: 6px;
        gap: 4px;
    }

    .lightbox-stats {
        gap: 6px;
        padding: 4px 6px;
    }

    .lightbox-stats .view-counter {
        font-size: 11px;
    }
}

/* スマホ版ライトボックス：操作ボタンを画面基準で固定 */
@media (max-width: 650px) {

    /* 右上：閉じる */
    .lightbox-top {
        top: env(safe-area-inset-top, 0px);
        right: 0;
    }

    /* 左下：リンク／右下：いいね・閲覧数 */
    .lightbox-bottom {
        position: fixed;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        width: auto;
    }

    /* 下中央：作品の枚数 */
    #lightPosition {
        position: fixed;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
    }
}

/* スマホで拡大画像を上下左右にドラッグできるようにする */
@media (max-width: 650px) {
    .lightbox-image-wrap {
        touch-action: none;
    }
}

/* スマホ版：閉じるボタンを正円に固定 */
@media (max-width: 650px) {
    #close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        box-sizing: border-box;
        flex: 0 0 44px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        line-height: 1;
    }
}

/* スマホ版：閲覧数をいいねと同じ大きさにする */
@media (max-width: 650px) {

    /* 閲覧数の数字 */
    #lightViews .view-counter {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 14px;
        line-height: 1;
    }

    /* 閲覧数の棒グラフアイコン */
    #lightViews .view-icon svg {
        width: 24px;
        height: 24px;
        display: block;
    }
}

/* PC版ライトボックス：操作ボタンを画面の余白に配置 */
@media (min-width: 651px) {

    /* 左下：リンク／右下：いいね・閲覧数 */
    .lightbox-bottom {
        position: fixed;
        bottom: 20px;
        left: 24px;
        right: 24px;
        width: auto;
    }

    /* 左上：作品の枚数 */
    #lightPosition {
        position: fixed;
        top: 20px;
        bottom: auto;
        left: 24px;
        transform: none;
    }
}

/* 回転ボタンはスマホでは非表示 */
#rotateImage {
    display: none;
}

/* PC版：右上に回転ボタンを配置 */
@media (min-width: 651px) {
    .lightbox-top {
        gap: 8px;
    }

    #rotateImage {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        flex: 0 0 44px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.88);
    }

    /* 横向きに回転した画像が枠で切れないようにする */
    .lightbox.rotated .lightbox-image-wrap {
        overflow: visible;
    }
}

/* ライトボックス：操作アイコンの表示・非表示 */
.lightbox.controls-hidden .lightbox-top .icon-btn,
.lightbox.controls-hidden .lightbox-bottom,
.lightbox.controls-hidden .arrow,
.lightbox.controls-hidden #lightPosition {
    visibility: hidden;
    pointer-events: none;
}

/* 並び替えメニュー：赤いフォーカス枠を非表示 */
#sort:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* キーボード操作時は控えめなグレーの枠を表示 */
#sort:focus-visible {
    outline: 2px solid #888 !important;
    outline-offset: 2px;
}

/* サイト説明：フッターのリンク */
.site-about-trigger {
    border: none;
    background: none;
    padding: 8px 12px;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.site-about-trigger:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* サイト説明：中央パネル */
.site-about-dialog {
    box-sizing: border-box;
    width: min(920px, calc(100% - 32px));
    max-width: 920px;
    max-height: 90vh;
    margin: auto;
    padding: clamp(65px, 8vw, 110px) 24px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background: #ffffff;
    color: #222222;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
}

.site-about-dialog::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

/* 閉じるボタン */
.site-about-close {
    position: absolute;
    top: 14px;
    right: 18px;
    border: none;
    background: transparent;
    color: #555555;
    font-size: 28px;
    cursor: pointer;
}

/* 説明文：上品な明朝体 */
.site-about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 38px;
    font-family: "Yu Mincho", "Hiragino Mincho ProN",
        "Noto Serif JP", serif;
    text-align: center;
}

.site-about-content p {
    margin: 0;
    font-size: clamp(19px, 2.2vw, 29px);
    font-weight: 400;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

/* 黄色と黒の放射能マーク */
.site-about-radiation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    margin-left: 3px;
    border-radius: 50%;
    background: #ffe135;
    color: #111111;
    font-family: Arial, sans-serif;
    vertical-align: middle;
    line-height: 1;
}

/* スマートフォン対応 */
@media (max-width: 650px) {
    .site-about-dialog {
        padding: 75px 20px;
    }

    .site-about-content {
        gap: 26px;
    }

    .site-about-content p {
        font-size: clamp(17px, 4.5vw, 22px);
    }
}


/* スマホ版：回転ボタンは左上、閉じるボタンは右上 */
@media (max-width: 650px) {
    #rotateImage {
        display: grid;
        place-items: center;

        position: fixed;
        top: calc(12px + env(safe-area-inset-top, 0px));
        left: calc(12px + env(safe-area-inset-left, 0px));

        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;

        background: rgba(255, 255, 255, 0.85);
        border-radius: 50%;
        z-index: 20;
    }
}

/* スマホ版：回転した画像が元の表示枠で切れないようにする */
@media (max-width: 650px) {
    .lightbox.rotated .lightbox-image-wrap {
        overflow: visible;
    }
}

/* スマホ版：回転ボタンのダブルタップ拡大を抑制 */
@media (max-width: 650px) {
    #rotateImage {
        touch-action: manipulation;
    }
}