/* ==========================================
   asellog STRAT BOARD & MACRO GALLERY CSS
   クラス接頭辞: asl-sg-
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');

:root {
    --sg-bg: #0f0f1a;
    --sg-surface: #1a1a2e;
    --sg-card: rgba(22, 22, 40, 0.95);
    --sg-card-hover: rgba(28, 28, 52, 0.98);
    --sg-border: rgba(255, 255, 255, 0.08);
    --sg-border-hover: rgba(255, 255, 255, 0.18);
    --sg-accent-r: #84172F;
    --sg-accent-r-bright: #c4294a;
    --sg-accent-g: #057A45;
    --sg-accent-g-bright: #0aad61;
    --sg-gold: #c9a84c;
    --sg-text: #f0f0f0;
    --sg-sub: #999;
    --sg-muted: #666;
    --sg-radius: 12px;
    --sg-radius-sm: 8px;
    --sg-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --sg-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.7);
    --sg-transition: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.asl-sg-root {
    background: var(--sg-bg);
    color: var(--sg-text);
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- Hero Header ---- */
.asl-sg-hero {
    background: linear-gradient(180deg, #0a0a18 0%, var(--sg-surface) 100%);
    border-bottom: 1px solid var(--sg-border);
    padding: 40px 20px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.asl-sg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(132, 23, 47, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(5, 122, 69, 0.10) 0%, transparent 60%);
    pointer-events: none;
}

.asl-sg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sg-gold);
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 16px;
}

.asl-sg-hero-title {
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.asl-sg-hero-sub {
    font-size: 14px;
    color: var(--sg-sub);
    margin-bottom: 24px;
    line-height: 1.7;
}

.asl-sg-hero-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.asl-sg-stat {
    text-align: center;
}

.asl-sg-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.asl-sg-stat-label {
    font-size: 11px;
    color: var(--sg-muted);
    margin-top: 3px;
    letter-spacing: 0.5px;
}

.asl-sg-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--sg-accent-r) 0%, #6b1226 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--sg-radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--sg-transition), box-shadow var(--sg-transition);
    box-shadow: 0 4px 20px rgba(132, 23, 47, 0.4);
}

.asl-sg-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(132, 23, 47, 0.6);
    color: #fff;
    text-decoration: none;
}

/* ---- Main Layout ---- */
.asl-sg-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ---- Filter Bar ---- */
.asl-sg-filter-bar {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
    padding: 18px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.asl-sg-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.asl-sg-search-wrap {
    flex: 1;
    position: relative;
}

.asl-sg-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sg-muted);
    font-size: 16px;
}

.asl-sg-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-sm);
    color: var(--sg-text);
    font-size: 14px;
    padding: 10px 14px 10px 38px;
    outline: none;
    font-family: inherit;
    transition: border-color var(--sg-transition);
}

.asl-sg-search::placeholder {
    color: var(--sg-muted);
}

.asl-sg-search:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.asl-sg-sort {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-sm);
    color: var(--sg-text);
    font-size: 13px;
    padding: 10px 34px 10px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    min-width: 120px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.asl-sg-sort option,
.asl-sg-select option {
    background-color: #14142a;
    color: #f0f0f0;
}

/* Type Tabs */
.asl-sg-type-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.asl-sg-type-tab {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--sg-border);
    background: transparent;
    color: var(--sg-sub);
    cursor: pointer;
    transition: all var(--sg-transition);
    font-family: inherit;
}

.asl-sg-type-tab:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.asl-sg-type-tab.active {
    background: var(--sg-accent-r);
    border-color: var(--sg-accent-r);
    color: #fff;
}

.asl-sg-type-tab[data-type="strat"].active {
    background: var(--sg-accent-g);
    border-color: var(--sg-accent-g);
}

.asl-sg-type-tab[data-type="macro"].active {
    background: #3b5bdb;
    border-color: #3b5bdb;
}

.asl-sg-type-tab[data-type="meme"].active {
    background: #9c36b5;
    border-color: #9c36b5;
}

/* Tag Chips */
.asl-sg-tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.asl-sg-tag-chip {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--sg-border);
    color: var(--sg-sub);
    background: transparent;
    cursor: pointer;
    transition: all var(--sg-transition);
    font-family: inherit;
}

.asl-sg-tag-chip:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.asl-sg-tag-chip.active {
    background: rgba(201, 168, 76, 0.18);
    border-color: rgba(201, 168, 76, 0.4);
    color: var(--sg-gold);
}

/* Result Info */
.asl-sg-result-info {
    font-size: 13px;
    color: var(--sg-muted);
    margin-bottom: 16px;
}

.asl-sg-result-info span {
    color: var(--sg-text);
    font-weight: 600;
}

/* ---- Gallery Grid ---- */
.asl-sg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ---- Card ---- */
.asl-sg-card {
    background: var(--sg-card);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--sg-transition), border-color var(--sg-transition), box-shadow var(--sg-transition);
    box-shadow: var(--sg-shadow);
    display: flex;
    flex-direction: column;
}

.asl-sg-card:hover {
    transform: translateY(-4px);
    border-color: var(--sg-border-hover);
    box-shadow: var(--sg-shadow-hover);
    background: var(--sg-card-hover);
}

/* Card image area */
.asl-sg-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #0d0d1a;
}

.asl-sg-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.asl-sg-card:hover .asl-sg-card-img-wrap img {
    transform: scale(1.04);
}

/* No-image state (code preview) */
.asl-sg-card-no-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #12122a 0%, #1a1a35 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: 11px;
    color: var(--sg-muted);
    font-family: 'Courier New', monospace;
    padding: 40px 14px 14px;
    /* top: タイプバッジ分をクリア */
    text-align: left;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
    overflow: hidden;
}

/* ネタ用：絵文字を中央に大きく */
.asl-sg-card-no-img.no-img-meme {
    align-items: center;
    justify-content: center;
    font-size: 48px;
    padding: 14px;
}

/* Type badge */
.asl-sg-card-type {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.type-strat {
    background: rgba(5, 122, 69, 0.85);
    color: #7fffc4;
}

.type-macro {
    background: rgba(59, 91, 219, 0.85);
    color: #a5c8ff;
}

.type-meme {
    background: rgba(156, 54, 181, 0.85);
    color: #e9a3ff;
}

/* Rank badge */
.asl-sg-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #1a1a00;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: #111;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #fff;
}

/* Card body */
.asl-sg-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asl-sg-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.asl-sg-card-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--sg-sub);
    border: 1px solid var(--sg-border);
}

.asl-sg-card-tag.content-tag {
    background: rgba(201, 168, 76, 0.12);
    border-color: rgba(201, 168, 76, 0.25);
    color: var(--sg-gold);
}

.asl-sg-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.45;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asl-sg-card-desc {
    font-size: 12px;
    color: var(--sg-sub);
    line-height: 1.6;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Card footer */
.asl-sg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--sg-border);
}

.asl-sg-card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.asl-sg-card-author {
    font-size: 11px;
    color: var(--sg-muted);
}

.asl-sg-card-author span {
    color: var(--sg-sub);
}

.asl-sg-card-date {
    font-size: 11px;
    color: var(--sg-muted);
}

.asl-sg-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.asl-sg-like-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--sg-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sg-border);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-like-btn:hover,
.asl-sg-like-btn.liked {
    color: #ff6b8a;
    border-color: rgba(255, 107, 138, 0.35);
    background: rgba(255, 107, 138, 0.1);
}

.asl-sg-like-btn.liked .asl-sg-heart {
    filter: none;
}

.asl-sg-copy-btn {
    font-size: 12px;
    color: var(--sg-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sg-border);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
    white-space: nowrap;
}

.asl-sg-copy-btn:hover {
    color: var(--sg-accent-g-bright);
    border-color: rgba(10, 173, 97, 0.35);
    background: rgba(10, 173, 97, 0.1);
}

.asl-sg-copy-btn.copied {
    color: var(--sg-accent-g-bright);
    border-color: rgba(10, 173, 97, 0.5);
}

/* ---- Empty State ---- */
.asl-sg-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 20px;
    color: var(--sg-muted);
}

.asl-sg-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.asl-sg-empty-text {
    font-size: 16px;
    font-weight: 600;
}

/* ---- Modal ---- */
.asl-sg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.asl-sg-modal-overlay.open {
    display: flex;
}

.asl-sg-modal {
    background: #16162a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: sgModalIn 0.22s ease;
}

@keyframes sgModalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.asl-sg-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--sg-border);
    color: var(--sg-sub);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
    transition: background var(--sg-transition);
}

.asl-sg-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.asl-sg-modal-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
    display: block;
}

.asl-sg-modal-body {
    padding: 20px 24px 24px;
}

.asl-sg-modal-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: center;
}

.asl-sg-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 10px;
}

.asl-sg-modal-desc {
    font-size: 13px;
    color: var(--sg-sub);
    line-height: 1.8;
    margin-bottom: 18px;
}

/* Share Code Box */
.asl-sg-code-box {
    background: #0a0a18;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--sg-radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.asl-sg-code-box-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--sg-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.asl-sg-code-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #a8d8a8;
    word-break: break-all;
    line-height: 1.65;
    white-space: pre-wrap;
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.asl-sg-code-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-accent-g-bright);
    background: rgba(10, 173, 97, 0.12);
    border: 1px solid rgba(10, 173, 97, 0.3);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-code-copy-btn:hover {
    background: rgba(10, 173, 97, 0.22);
}

.asl-sg-code-copy-btn.copied {
    background: rgba(10, 173, 97, 0.25);
}

.asl-sg-modal-actions {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--sg-border);
    padding-top: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.asl-sg-modal-like {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-sub);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sg-border);
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-modal-like:hover,
.asl-sg-modal-like.liked {
    color: #ff6b8a;
    border-color: rgba(255, 107, 138, 0.4);
    background: rgba(255, 107, 138, 0.1);
}

.asl-sg-modal-share {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-sub);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sg-border);
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
    text-decoration: none;
}

.asl-sg-modal-share:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ---- Delete Buttons ---- */
.asl-sg-modal-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #ff6b6b;
    background: rgba(255, 80, 80, 0.08);
    border: 1px solid rgba(255, 80, 80, 0.3);
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
    margin-left: auto;
}

.asl-sg-modal-delete:hover {
    background: rgba(255, 80, 80, 0.18);
    border-color: rgba(255, 80, 80, 0.55);
}

/* Card delete button */
.asl-sg-delete-btn {
    font-size: 13px;
    color: #ff6b6b;
    background: rgba(255, 80, 80, 0.08);
    border: 1px solid rgba(255, 80, 80, 0.25);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-delete-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.5);
}

/* ---- Post Modal ---- */
.asl-sg-post-modal {
    max-width: 560px;
}

.asl-sg-form-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--sg-border);
}

.asl-sg-form-group {
    margin-bottom: 16px;
}

.asl-sg-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sg-sub);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.asl-sg-form-label span {
    color: var(--sg-accent-r-bright);
}

.asl-sg-input,
.asl-sg-select,
.asl-sg-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-sm);
    color: var(--sg-text);
    font-size: 13px;
    padding: 10px 14px;
    outline: none;
    font-family: inherit;
    transition: border-color var(--sg-transition);
}

.asl-sg-input::placeholder,
.asl-sg-textarea::placeholder {
    color: var(--sg-muted);
}

.asl-sg-input:focus,
.asl-sg-select:focus,
.asl-sg-textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.asl-sg-textarea {
    resize: vertical;
    min-height: 90px;
}

.asl-sg-select option {
    background: #1a1a2e;
}

.asl-sg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.asl-sg-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--sg-accent-r), #6b1226);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 13px;
    border: none;
    border-radius: var(--sg-radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: transform var(--sg-transition), box-shadow var(--sg-transition);
    margin-top: 4px;
}

.asl-sg-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(132, 23, 47, 0.5);
}

/* ---- Toast ---- */
.asl-sg-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #222238;
    border: 1px solid rgba(10, 173, 97, 0.4);
    border-radius: var(--sg-radius-sm);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-accent-g-bright);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.asl-sg-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .asl-sg-hero {
        padding: 28px 16px 24px;
    }

    .asl-sg-grid {
        grid-template-columns: 1fr;
    }

    .asl-sg-search-row {
        flex-direction: column;
    }

    .asl-sg-sort {
        width: 100%;
    }

    .asl-sg-form-row {
        grid-template-columns: 1fr;
    }

    .asl-sg-modal {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
}

/* ==========================================
   Macro Toolbar
   ========================================== */
.asl-sg-macro-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: rgba(132, 23, 47, 0.10);
    border: 1px solid rgba(132, 23, 47, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.asl-sg-toolbar-label {
    font-size: 11px;
    color: var(--sg-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-right: 2px;
}

.asl-sg-tag-insert-btn {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #c0a060;
    background: rgba(192, 160, 96, 0.10);
    border: 1px solid rgba(192, 160, 96, 0.25);
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all var(--sg-transition);
    user-select: none;
}

.asl-sg-tag-insert-btn:hover {
    background: rgba(192, 160, 96, 0.22);
    border-color: rgba(192, 160, 96, 0.5);
    color: #e0c080;
}

/* ==========================================
   Admin Bar
   ========================================== */
.asl-sg-admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    background: rgba(130, 20, 20, 0.95);
    border-bottom: 2px solid #ff4444;
    backdrop-filter: blur(8px);
    font-size: 13px;
    flex-wrap: wrap;
}

.asl-sg-admin-badge {
    font-weight: 800;
    color: #fff;
    background: rgba(255, 0, 0, 0.3);
    border: 1px solid rgba(255, 80, 80, 0.5);
    border-radius: 6px;
    padding: 3px 10px;
    letter-spacing: 0.05em;
}

.asl-sg-admin-hint {
    color: rgba(255, 200, 200, 0.85);
    font-size: 12px;
}

.asl-sg-admin-exit {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 5px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-admin-exit:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Admin action buttons on cards */
.asl-sg-admin-del-btn,
.asl-sg-admin-ban-btn {
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
}

.asl-sg-admin-del-btn {
    color: #ff8080;
    background: rgba(255, 80, 80, 0.10);
    border: 1px solid rgba(255, 80, 80, 0.28);
}

.asl-sg-admin-del-btn:hover {
    background: rgba(255, 80, 80, 0.22);
}

.asl-sg-admin-ban-btn {
    color: #ffaa40;
    background: rgba(255, 160, 40, 0.10);
    border: 1px solid rgba(255, 160, 40, 0.28);
}

.asl-sg-admin-ban-btn:hover {
    background: rgba(255, 160, 40, 0.22);
}

/* ==========================================
   Tag Picker (Post Form)
   ========================================== */
.asl-sg-tag-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sg-border);
    border-radius: 8px;
}

.asl-sg-tag-pick {
    font-size: 12px;
    font-weight: 600;
    color: var(--sg-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sg-border);
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--sg-transition);
    user-select: none;
}

.asl-sg-tag-pick:hover {
    color: var(--sg-sub);
    background: rgba(255, 255, 255, 0.08);
}

.asl-sg-tag-pick.selected {
    color: var(--sg-accent-g-bright, #0aad61);
    background: rgba(10, 173, 97, 0.12);
    border-color: rgba(10, 173, 97, 0.4);
}

/* ==========================================
   Changelog Section
   ========================================== */
.asl-sg-changelog {
    margin-top: 60px;
    padding-top: 36px;
    border-top: 1px solid var(--sg-border);
}

.asl-sg-changelog-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--sg-muted);
    margin-bottom: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.asl-sg-changelog-list {
    display: flex;
    flex-direction: column;
}

.asl-sg-changelog-entry {
    display: grid;
    grid-template-columns: 64px 72px 1fr;
    gap: 0 14px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.asl-sg-changelog-entry:last-child {
    border-bottom: none;
}

.asl-sg-changelog-ver {
    font-size: 11px;
    font-weight: 800;
    color: var(--sg-gold);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.asl-sg-changelog-date {
    font-size: 11px;
    color: var(--sg-muted);
    white-space: nowrap;
}

.asl-sg-changelog-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asl-sg-changelog-items li {
    font-size: 12px;
    color: var(--sg-muted);
    line-height: 1.65;
    padding-left: 12px;
    position: relative;
}

.asl-sg-changelog-items li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: rgba(255,255,255,0.15);
}

/* 管理者専用 changelog */
.asl-sg-changelog-admin {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 68, 68, 0.2);
    background: rgba(130, 20, 20, 0.06);
    border-radius: var(--sg-radius-sm);
    padding: 20px;
}

.asl-sg-changelog-admin .asl-sg-changelog-title {
    color: rgba(255, 150, 150, 0.7);
}

.asl-sg-changelog-admin .asl-sg-changelog-ver {
    color: rgba(255, 150, 100, 0.8);
}

.asl-sg-changelog-admin .asl-sg-changelog-items li {
    color: rgba(255, 200, 200, 0.55);
}

@media (max-width: 640px) {
    .asl-sg-changelog-entry {
        grid-template-columns: 56px 1fr;
    }
    .asl-sg-changelog-date {
        display: none;
    }
}


/* 公開前ラベル */
.asl-sg-changelog-date.pre-release {
    font-style: italic;
    opacity: 0.45;
    font-size: 10px;
}


/* ==========================================
   Contents Manager Panel（管理者専用）
   ========================================== */
.asl-sg-contents-panel {
    background: rgba(20, 10, 40, 0.85);
    border: 1px solid rgba(180, 100, 255, 0.25);
    border-radius: var(--sg-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.asl-sg-contents-panel-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.asl-sg-contents-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: rgba(200, 150, 255, 0.9);
    letter-spacing: 0.05em;
}

.asl-sg-contents-panel-hint {
    font-size: 11px;
    color: var(--sg-muted);
}

/* コンテンツ行 */
.asl-sg-contents-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 14px;
}

.asl-sg-content-row {
    display: grid;
    grid-template-columns: 52px 1fr 2fr 32px;
    gap: 8px;
    align-items: center;
}

.asl-sg-content-move {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asl-sg-content-move-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--sg-muted);
    font-size: 9px;
    padding: 2px 5px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.asl-sg-content-move-btn:hover:not(:disabled) {
    background: rgba(180,100,255,0.15);
    color: #fff;
}
.asl-sg-content-move-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.asl-sg-content-value,
.asl-sg-content-label {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.asl-sg-content-value:focus,
.asl-sg-content-label:focus {
    outline: none;
    border-color: rgba(180,100,255,0.5);
}
.asl-sg-content-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.asl-sg-content-del {
    background: transparent;
    border: 1px solid rgba(255,80,80,0.2);
    border-radius: 6px;
    color: rgba(255,100,100,0.6);
    font-size: 12px;
    padding: 5px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.asl-sg-content-del:hover {
    background: rgba(255,80,80,0.12);
    border-color: rgba(255,80,80,0.5);
    color: #ff8080;
}

/* アクションボタン */
.asl-sg-contents-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.asl-sg-contents-add-btn,
.asl-sg-contents-save-btn,
.asl-sg-contents-reset-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
}
.asl-sg-contents-add-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ccc;
}
.asl-sg-contents-add-btn:hover {
    background: rgba(255,255,255,0.1);
}
.asl-sg-contents-save-btn {
    background: rgba(10, 173, 97, 0.15);
    border: 1px solid rgba(10,173,97,0.4);
    color: #0aad61;
}
.asl-sg-contents-save-btn:hover:not(:disabled) {
    background: rgba(10,173,97,0.25);
}
.asl-sg-contents-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.asl-sg-contents-reset-btn {
    background: transparent;
    border: 1px solid rgba(255,180,50,0.2);
    color: rgba(255,180,50,0.6);
    font-size: 11px;
    padding: 8px 12px;
}
.asl-sg-contents-reset-btn:hover {
    border-color: rgba(255,180,50,0.5);
    color: #ffb432;
}

@media (max-width: 640px) {
    .asl-sg-content-row {
        grid-template-columns: 44px 1fr 32px;
        grid-template-rows: auto auto;
    }
    .asl-sg-content-move {
        grid-row: 1 / 3;
    }
    .asl-sg-content-value {
        grid-column: 2;
    }
    .asl-sg-content-label {
        grid-column: 2;
    }
    .asl-sg-content-del {
        grid-column: 3;
        grid-row: 1;
    }
}


/* ==========================================
   Notice Banner
   ========================================== */
.asl-sg-notice-banner {
    background: linear-gradient(135deg, rgba(180,100,255,0.12) 0%, rgba(10,173,97,0.08) 100%);
    border: 1px solid rgba(180,100,255,0.25);
    border-radius: var(--sg-radius);
    padding: 14px 20px;
    margin: 0 0 20px;
    text-align: center;
    font-size: 13px;
    color: #ddd;
    line-height: 1.7;
}
.asl-sg-notice-banner .asl-sg-banner-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* ==========================================
   Admin Panels（共通）
   ========================================== */
.asl-sg-admin-panel {
    background: rgba(20, 10, 40, 0.85);
    border: 1px solid rgba(180, 100, 255, 0.25);
    border-radius: var(--sg-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.asl-sg-admin-panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.asl-sg-admin-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: rgba(200, 150, 255, 0.9);
    letter-spacing: 0.05em;
}
.asl-sg-admin-panel-hint {
    font-size: 11px;
    color: var(--sg-muted);
}

/* ==========================================
   Banner Manager
   ========================================== */
.asl-sg-banner-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.asl-sg-banner-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
}
.asl-sg-banner-type-row {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #ccc;
}
.asl-sg-banner-type-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.asl-sg-banner-textarea {
    width: 100%;
    min-height: 72px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 12px;
    box-sizing: border-box;
    resize: vertical;
}
.asl-sg-banner-textarea:focus {
    outline: none;
    border-color: rgba(180,100,255,0.5);
}
#sg-banner-img-wrap small {
    font-size: 11px;
    color: var(--sg-muted);
    margin-top: 4px;
    display: block;
}

/* ==========================================
   BAN List
   ========================================== */
.asl-sg-banlist-refresh {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #ccc;
    font-size: 11px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.asl-sg-banlist-refresh:hover { background: rgba(255,255,255,0.12); }
.asl-sg-banlist-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}
.asl-sg-ban-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255,80,80,0.05);
    border: 1px solid rgba(255,80,80,0.1);
    border-radius: 6px;
}
.asl-sg-ban-author {
    font-size: 13px;
    font-weight: 700;
    color: #e0e0e0;
}
.asl-sg-ban-token {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: var(--sg-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asl-sg-ban-unban {
    background: rgba(10,173,97,0.1);
    border: 1px solid rgba(10,173,97,0.3);
    border-radius: 6px;
    color: #0aad61;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.asl-sg-ban-unban:hover { background: rgba(10,173,97,0.2); }

/* ==========================================
   Stats Dashboard
   ========================================== */
.asl-sg-stats-body { font-size: 12px; }
.asl-sg-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 640px) { .asl-sg-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.asl-sg-stats-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}
.asl-sg-stats-num {
    font-size: 22px;
    font-weight: 900;
    color: var(--sg-gold, #ffd700);
    line-height: 1;
    margin-bottom: 4px;
}
.asl-sg-stats-lbl { font-size: 10px; color: var(--sg-muted); }
.asl-sg-stats-section { margin-bottom: 16px; }
.asl-sg-stats-section-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(200,150,255,0.7);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.asl-sg-stats-row-list { display: flex; flex-direction: column; gap: 5px; }
.asl-sg-stats-row {
    display: grid;
    grid-template-columns: 130px 1fr 36px;
    gap: 8px;
    align-items: center;
}
.asl-sg-stats-row-lbl { font-size: 12px; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asl-sg-stats-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.asl-sg-stats-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(180,100,255,0.7), rgba(10,173,97,0.5));
    border-radius: 4px;
    transition: width 0.4s ease;
}
.asl-sg-stats-row-val { font-size: 11px; color: var(--sg-muted); text-align: right; }
.asl-sg-stats-top-list { display: flex; flex-direction: column; gap: 5px; }
.asl-sg-stats-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}
.asl-sg-stats-top-rank { font-size: 14px; flex-shrink: 0; width: 22px; }
.asl-sg-stats-top-title { flex: 1; font-size: 12px; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asl-sg-stats-top-likes { font-size: 12px; color: rgba(255,100,100,0.8); flex-shrink: 0; }

/* ==========================================
   Pin Button & Badge
   ========================================== */
.asl-sg-admin-pin-btn {
    background: rgba(255,200,50,0.08);
    border: 1px solid rgba(255,200,50,0.2);
    border-radius: 6px;
    color: rgba(255,200,50,0.6);
    font-size: 11px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.asl-sg-admin-pin-btn:hover,
.asl-sg-admin-pin-btn.pinned {
    background: rgba(255,200,50,0.2);
    border-color: rgba(255,200,50,0.5);
    color: #ffc832;
}
.asl-sg-pin-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 16px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
    z-index: 2;
    pointer-events: none;
}


/* ==========================================
   Token Backup Notice Modal
   ========================================== */
.asl-sg-token-modal {
    max-width: 480px;
    width: 90%;
}
.asl-sg-token-notice-icon {
    font-size: 36px;
    text-align: center;
    margin-bottom: 12px;
}
.asl-sg-token-notice-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 12px;
}
.asl-sg-token-notice-desc {
    font-size: 13px;
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 16px;
    text-align: center;
}
.asl-sg-token-notice-desc strong {
    color: #fff;
}
.asl-sg-token-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.asl-sg-token-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #adf;
    word-break: break-all;
    user-select: all;
}
.asl-sg-token-copy-btn {
    background: rgba(10,173,97,0.15);
    border: 1px solid rgba(10,173,97,0.4);
    border-radius: 6px;
    color: #0aad61;
    font-size: 12px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}
.asl-sg-token-copy-btn:hover { background: rgba(10,173,97,0.25); }
.asl-sg-token-skip {
    font-size: 11px;
    color: var(--sg-muted);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
}
.asl-sg-token-close-btn {
    display: block;
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.asl-sg-token-close-btn:hover { background: rgba(255,255,255,0.1); }
