/* /pixel/ ギャラリー・詳細ページ共通：モーダル・いいねボタン・グリッドカード */

.pixel-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

/* ギャラリーグリッド */
.pixel-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.pixel-gallery-card {
    min-width: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: border-color .12s;
    text-align: center;
}
.pixel-gallery-card:hover {
    border-color: #f59e0b;
}
.pixel-gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border-radius: 6px;
    background: #0f172a;
    display: block;
    margin-bottom: 6px;
}
.pixel-gallery-name {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pixel-gallery-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
}
.pixel-gallery-id {
    font-size: 10px;
    color: #64748b;
}

@media (max-width: 640px) {
    .pixel-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .pixel-gallery-card {
        padding: 5px;
        border-radius: 8px;
    }
    .pixel-gallery-name {
        font-size: 9px;
    }
    .pixel-gallery-id {
        font-size: 8px;
    }
    .pixel-like-btn--meta {
        width: 15px;
        height: 15px;
        font-size: 8px;
    }
}

/* いいねボタン（角バッジ型） */
.pixel-like-btn {
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, .35);
    background: rgba(2, 6, 23, .72);
    color: #fca5a5;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s, background .12s, border-color .12s;
}
.pixel-like-btn:hover {
    border-color: rgba(251, 191, 36, .7);
    background: rgba(15, 23, 42, .92);
}
.pixel-like-btn:active,
.pixel-like-btn.is-pulsing {
    transform: scale(1.22);
}
/* インライン型（モーダル内の各投稿カード用） */
.pixel-like-btn--inline {
    position: static;
    width: auto;
    height: auto;
    border-radius: 6px;
    padding: .3rem .6rem;
    font-size: 12px;
    font-weight: 700;
    gap: .3rem;
}
/* メタ行型（ギャラリーカードの ID 横に並べる小型アイコン） */
.pixel-like-btn--meta {
    position: static;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    font-size: 11px;
}

/* モーダル */
.pixel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.pixel-modal-overlay.hidden { display: none; }
.pixel-modal-box {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 1.25rem;
    max-width: 480px;
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
}
.pixel-modal-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .75rem 0;
    border-top: 1px solid #334155;
}
.pixel-modal-item:first-child {
    border-top: none;
    padding-top: 0;
}
.pixel-modal-canvas {
    border: 1px solid #334155;
    border-radius: 4px;
    flex-shrink: 0;
    background: #0f172a;
}
.pixel-modal-badge-primary {
    display: inline-flex;
    align-items: center;
    background: rgba(180, 83, 9, .25);
    border: 1px solid #b45309;
    color: #fde68a;
    border-radius: 4px;
    padding: 0 .4rem;
    font-size: 11px;
    font-weight: 700;
}
.pixel-modal-link {
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 2px;
}
