:root{
    --bg:#0b1020;
    --card:#121a33;
    --panel:#1a2440;
    --line:#253a66;
    --text:#f3f6ff;
    --muted:#aeb9d6;
    --accent:#4ea1ff;
    --danger:#ff6b6b;
    --ok:#36d399;
    --warn:#ffd166;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background:#0b1528;
    color:var(--text);
    min-width:1500px;
    overflow-x:auto;
}

a{
    color:#9ec7ff;
    text-decoration:none;
}

.container{
    max-width:1180px;
    margin:auto;
    padding:22px;
}

/* ===============================
   Header
=============================== */
.site-header{
    background:#081120;
    border-bottom:1px solid #14213d;
    position:sticky;
    top:0;
    z-index:20;
}

.header-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding-top:14px;
    padding-bottom:14px;
}

.logo{
    font-size:26px;
    font-weight:800;
    color:#4ea1ff;
    letter-spacing:.03em;
}

nav a{
    margin-left:16px;
    color:#d6e4ff;
}

/* ===============================
   Common Parts
=============================== */
.hero,
.form,
.detail,
.panel{
    background:rgba(26,36,64,.94);
    border:1px solid var(--line);
    border-radius:18px;
    padding:26px;
    margin-bottom:22px;
}

.hero h1{
    font-size:32px;
}

.search-row{
    display:grid;
    grid-template-columns:1fr 220px 160px;
    gap:12px;
    margin-top:16px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,300px);
    gap:20px;
}

.card{
    background:rgba(18,26,51,.96);
    border:1px solid var(--line);
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 12px 35px rgba(0,0,0,.18);
    display:flex;
    flex-direction:column;
}

.thumb-wrap{
    height:190px;
    background:#0c1224;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.thumb{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
    display:block;
}

.card-body{
    padding:14px;
    display:flex;
    flex-direction:column;
    gap:10px;
    flex:1;
}

.card h2{
    font-size:18px;
    line-height:1.3;
    min-height:50px;
    margin:4px 0;
}

.badge{
    display:inline-block;
    padding:4px 9px;
    border:1px solid var(--line);
    border-radius:999px;
    color:#cfe0ff;
    font-size:12px;
}

.badge.limited{
    background:#3b2507;
    border-color:#8a5b10;
    color:#ffd166;
}

.meta{
    color:var(--muted);
    font-size:13px;
}

.desc{
    line-height:1.55;
}

.btn{
    display:inline-block;
    background:var(--accent);
    color:#fff;
    border:0;
    padding:9px 18px;
    border-radius:8px;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
    transition:.2s;
}

.btn.secondary,
.btn-secondary{
    background:#39424e;
    color:#fff;
}

.btn.secondary:hover,
.btn-secondary:hover{
    background:#505b68;
}

.btn.danger{
    background:var(--danger);
}

.btn.ok{
    background:var(--ok);
    color:#07101d;
}

.btn-primary{
    background:#1976d2;
    color:#fff;
    border:none;
}

.btn-primary:hover{
    background:#1565c0;
}

label{
    display:block;
    margin-top:14px;
    color:#cbd5ee;
}

input,
textarea,
select{
    width:100%;
    margin-top:6px;
    padding:11px;
    border-radius:10px;
    border:1px solid var(--line);
    background:#0c1224;
    color:var(--text);
}

textarea{
    min-height:120px;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.form-grid .full{
    grid-column:1/-1;
}

.form-actions{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:12px;
    margin-top:24px;
}

.table{
    width:100%;
    border-collapse:collapse;
    background:rgba(18,26,51,.96);
    border-radius:14px;
    overflow:hidden;
}

.table th,
.table td{
    border-bottom:1px solid var(--line);
    padding:10px;
    text-align:left;
    vertical-align:top;
}

.notice{
    background:#1d2b50;
    border:1px solid var(--line);
    padding:12px;
    border-radius:10px;
    margin:12px 0;
}

.warn{
    background:#402c12;
    border-color:#8a5b10;
    color:#ffe6ad;
}

.gallery{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:14px;
    margin:18px 0;
}

.gallery img{
    width:100%;
    height:auto;
    border-radius:14px;
    border:1px solid var(--line);
    display:block;
}

.detail-thumb{
    width:100%;
    max-width:100%;
    height:auto;
    border-radius:14px;
    border:1px solid var(--line);
    display:block;
    margin:14px 0;
}

.ad-box{
    border:2px dashed #7383b8;
    border-radius:14px;
    padding:24px;
    text-align:center;
    color:#cbd4f3;
    background:rgba(255,255,255,.04);
    margin:18px 0;
}

pre{
    white-space:pre-wrap;
    background:#0c1224;
    padding:14px;
    border-radius:12px;
    border:1px solid var(--line);
}

.actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

.actions a,
.actions .link-button{
    white-space:nowrap;
}

.link-button{
    background:none;
    border:0;
    color:#9ec7ff;
    cursor:pointer;
    padding:0;
    font:inherit;
}

/* ===============================
   Admin
=============================== */
.admin-layout{
    display:grid;
    grid-template-columns:240px 1fr;
    gap:18px;
}

.side{
    background:#101936;
    border:1px solid var(--line);
    border-radius:16px;
    padding:14px;
    height:max-content;
}

.side a{
    display:block;
    padding:10px;
    border-radius:10px;
    color:#dbe8ff;
}

.side a:hover{
    background:#1d2b50;
}

.shot-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
    gap:12px;
}

.shot-item{
    border:1px solid var(--line);
    padding:8px;
    border-radius:10px;
    background:#0c1224;
}

.shot-item img{
    width:100%;
    height:100px;
    object-fit:cover;
    border-radius:8px;
}

/* ===============================
   Admin Settings Page
=============================== */
.admin-settings-page{
    max-width:900px;
    margin:0 auto;
    padding:30px 20px;
}

.admin-settings-page h1{
    margin-bottom:24px;
}

.settings-card{
    background:#111a2f;
    border:1px solid #29446f;
    border-radius:16px;
    padding:28px;
    margin-bottom:24px;
}

.settings-card h2{
    margin-top:0;
    margin-bottom:22px;
    border-bottom:1px solid #29446f;
    padding-bottom:12px;
}

.settings-card label{
    display:block;
    margin-bottom:18px;
}

.settings-card input,
.settings-card textarea{
    width:100%;
    box-sizing:border-box;
    margin-top:8px;
}

/* ===============================
   Top Page Layout
=============================== */
/*
   ページ全体は .container の max-width:1180px のまま。
   サイドバーだけ transform で外側へ見た目移動する。
*/
body.home-page main.container{
    max-width:1300px;
    overflow:visible;
}

body.home-page .hero,
body.home-page .ad-box,
body.home-page .main-layout{
    max-width:100%;
    margin-left:0;
    margin-right:0;
}

.main-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 270px;
    gap:30px;
    align-items:start;
}

.content{
    min-width:0;
}

.sidebar{
    width:320px;
    position:sticky;
    top:90px;
    transform:translateX(320px);
    z-index:2;
}

@media (max-width:1400px){
    .sidebar{
        transform:translateX(180px);
    }
}

@media (max-width:1100px){
    .sidebar{
        transform:none;
    }
}

.sidebar-card{
    background:#111a2f;
    border:1px solid #29446f;
    border-radius:14px;
    padding:18px;
    margin-bottom:20px;
    box-shadow:0 10px 25px rgba(0,0,0,.25);
}

.sidebar-card h3{
    margin:0 0 14px;
    font-size:18px;
    color:#fff;
}

.sidebar-card ul{
    list-style:none;
    margin:0;
    padding:0;
}

.sidebar-card li{
    padding:8px 0;
    font-size:14px;
    border-bottom:1px solid #243653;
}

.sidebar-card li:last-child{
    border-bottom:none;
}

.sidebar-card a{
    display:block;
    color:#dce8ff;
    text-decoration:none;
    transition:.2s;

    white-space:nowrap;      /* 折り返さない */
    overflow:hidden;         /* はみ出しを隠す */
    text-overflow:ellipsis;  /* ... を表示 */
}

.sidebar-card a:hover{
    color:#4ea1ff;
    padding-left:6px;
}

/* ===============================
   Responsive
=============================== */
@media(max-width:900px){
    .main-layout{
        grid-template-columns:1fr;
    }

    .sidebar{
        width:100%;
        position:static;
    }
}

@media(max-width:760px){
    .search-row,
    .form-grid,
    .admin-layout{
        grid-template-columns:1fr;
    }

    .container{
        padding:14px;
    }

    .thumb-wrap{
        height:190px;
    }

    .card h2{
        min-height:auto;
    }

    .header-inner{
        align-items:flex-start;
        gap:8px;
        flex-direction:column;
    }

    nav a{
        margin:0 12px 0 0;
    }
}
.detail-thumb{
    max-width:100%;
    width:auto;
    height:auto;
    border-radius:14px;
    border:1px solid var(--line);
    display:block;
    margin:14px auto;   /* ←中央寄せ */
    cursor:pointer;
}

.gallery{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.gallery-thumb{
    width:10%;
    max-width:160px;
    min-width:100px;
    height:auto;
    object-fit:contain;
    cursor:pointer;
    border-radius:8px;
    border:2px solid transparent;
}

.gallery-thumb:hover{
    border-color:#4ea1ff;
}

/* ===============================
   Amazon Product Cards
=============================== */
.amazon-products{
    background:rgba(18,26,51,.96);
    border:1px solid var(--line);
    border-radius:16px;
    padding:20px;
    margin:24px 0;
}

.amazon-products h2{
    margin:0 0 16px;
    font-size:22px;
}

.amazon-product-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:16px;
}

.amazon-product-card{
    background:#0c1224;
    border:1px solid #29446f;
    border-radius:14px;
    overflow:hidden;
    text-align:center;
    transition:.2s;
}

.amazon-product-card:hover{
    transform:translateY(-2px);
    border-color:#4ea1ff;
}

.amazon-product-card a{
    display:block;
    color:#fff;
    padding:12px;
}

.amazon-product-image{
    height:120px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    margin-bottom:10px;
}

.amazon-product-image img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    display:block;
}

.amazon-product-title{
    font-size:14px;
    line-height:1.4;
    min-height:40px;
    color:#e8f0ff;
    margin-bottom:10px;
}

.amazon-product-btn{
    display:inline-block;
    background:#ff9900;
    color:#111;
    border-radius:999px;
    padding:7px 14px;
    font-size:13px;
    font-weight:700;
}

.admin-product-thumb{
    width:80px;
    height:60px;
    object-fit:contain;
    background:#fff;
    border-radius:8px;
    display:block;
}

.admin-product-preview{
    max-width:240px;
    max-height:180px;
    object-fit:contain;
    background:#fff;
    border-radius:12px;
    padding:8px;
}

.amazon-place-checks{
    margin-top:18px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#0c1224;
}

.check-row{
    display:flex !important;
    align-items:center;
    gap:8px;
    margin:8px 0 !important;
}

.check-row input{
    width:auto;
    margin:0;
}


/* ===============================
   Detail Screenshot Carousel - FINAL
   ※このブロックは必ずCSSの一番下に置く
=============================== */
.detail .screenshot-viewer{
    width:100% !important;
    max-width:1080px !important;
    margin:24px auto 20px !important;
    text-align:center !important;
}

.detail .screenshot-main{
    position:relative !important;
    display:block !important;
    width:100% !important;
    max-width:1080px !important;
    margin:0 auto !important;
    overflow:hidden !important;
    border-radius:20px !important;
    background:#081120 !important;
    border:1px solid rgba(78,161,255,.35) !important;
    box-shadow:0 20px 48px rgba(0,0,0,.38) !important;
}

.detail .screenshot-main .detail-thumb{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    margin:0 auto !important;
    border:0 !important;
    border-radius:0 !important;
    cursor:default !important;
}

/* ここが今回の本命：ボタンを画像の上に大きく表示 */
.detail .screenshot-main button.shot-nav{
    position:absolute !important;
    top:50% !important;
    width:58px !important;
    height:58px !important;
    padding:0 !important;
    margin:0 !important;
    border-radius:999px !important;
    border:1px solid rgba(255,255,255,.32) !important;
    background:
        linear-gradient(135deg,rgba(255,255,255,.26),rgba(255,255,255,.06)),
        rgba(8,17,32,.76) !important;
    color:transparent !important;
    font-size:0 !important;
    line-height:0 !important;
    text-indent:-9999px !important;
    overflow:hidden !important;
    cursor:pointer !important;
    z-index:50 !important;
    opacity:.95 !important;
    transform:translateY(-50%) !important;
    box-shadow:
        0 14px 34px rgba(0,0,0,.45),
        inset 0 1px 0 rgba(255,255,255,.30) !important;
    backdrop-filter:blur(10px) !important;
    -webkit-backdrop-filter:blur(10px) !important;
    transition:transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease !important;
    appearance:none !important;
    -webkit-appearance:none !important;
}

.detail .screenshot-main button.shot-nav-prev{
    left:18px !important;
}

.detail .screenshot-main button.shot-nav-next{
    right:18px !important;
}

.detail .screenshot-main button.shot-nav::before{
    content:"" !important;
    position:absolute !important;
    top:50% !important;
    left:50% !important;
    width:15px !important;
    height:15px !important;
    border-top:4px solid #fff !important;
    border-right:4px solid #fff !important;
    filter:drop-shadow(0 2px 3px rgba(0,0,0,.45)) !important;
}

.detail .screenshot-main button.shot-nav-prev::before{
    transform:translate(-35%,-50%) rotate(-135deg) !important;
}

.detail .screenshot-main button.shot-nav-next::before{
    transform:translate(-65%,-50%) rotate(45deg) !important;
}

.detail .screenshot-main button.shot-nav:hover{
    transform:translateY(-50%) scale(1.08) !important;
    background:
        linear-gradient(135deg,rgba(120,215,255,.98),rgba(43,113,255,.95)) !important;
    border-color:#d8eeff !important;
    box-shadow:
        0 18px 42px rgba(43,113,255,.52),
        inset 0 1px 0 rgba(255,255,255,.45) !important;
}

.detail .screenshot-main button.shot-nav:active{
    transform:translateY(-50%) scale(.95) !important;
}

.detail .shot-counter{
    position:absolute !important;
    right:16px !important;
    bottom:14px !important;
    padding:7px 13px !important;
    border-radius:999px !important;
    background:rgba(8,17,32,.76) !important;
    border:1px solid rgba(255,255,255,.20) !important;
    color:#fff !important;
    font-size:13px !important;
    font-weight:800 !important;
    z-index:51 !important;
    backdrop-filter:blur(8px) !important;
    -webkit-backdrop-filter:blur(8px) !important;
}



@media(max-width:760px){
    .detail .screenshot-main button.shot-nav{
        width:46px !important;
        height:46px !important;
    }

    .detail .screenshot-main button.shot-nav::before{
        width:12px !important;
        height:12px !important;
        border-top-width:3px !important;
        border-right-width:3px !important;
    }

    .detail .screenshot-main button.shot-nav-prev{
        left:10px !important;
    }

    .detail .screenshot-main button.shot-nav-next{
        right:10px !important;
    }

    .detail .screenshot-thumbs .gallery-thumb{
        flex-basis:120px !important;
        width:120px !important;
        height:68px !important;
    }
}

