/* MasterBinder 0.0.7 — comportamento/layout PokeBinders */

/* HEADER: gruppo account immediatamente a sinistra di Online, Online sempre ultimo a destra */
.header-right {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex: 0 1 auto;
}

.header-right .account-area {
    margin-top: 16px;
    flex-wrap: nowrap;
}

.header-right .header-status {
    display: flex !important;
    flex: 0 0 auto;
    order: 99;
}

/* ESPANSIONI */
.pokebinders-explore {
    align-items: start;
    min-height: 0;
}

.pokebinders-explore .explore-main {
    min-height: 0;
}

.pokebinders-table-panel {
    height: clamp(430px, calc(100vh - 345px), 680px);
    min-height: 430px;
    overflow-y: scroll;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.card-catalog-row {
    cursor: pointer;
}

.card-catalog-row.selected {
    background: #293958 !important;
    box-shadow: inset 3px 0 0 #6d9bea;
}

.card-catalog-row:focus-visible {
    outline: 2px solid #6d9bea;
    outline-offset: -2px;
}

.pokebinders-detail {
    position: sticky;
    top: 10px;
    height: min(650px, calc(100vh - 175px));
    min-height: 520px;
    padding: 16px;
    overflow: hidden;
}

.detail-card-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.preview-image-shell {
    width: min(100%, 286px);
    height: 398px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

#cardPreviewImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 16px 22px rgba(0,0,0,.34));
}

.preview-image-shell .card-placeholder {
    width: 230px;
}

.detail-card-view h2 {
    width: 100%;
    margin: 10px 0 2px;
    color: #fff;
    font-size: 20px;
    line-height: 1.25;
}

.preview-set-name {
    min-height: 18px;
    color: #8fa2c5;
    font-size: 12px;
}

.preview-data {
    width: 100%;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.preview-data > div {
    min-width: 0;
    padding: 7px 9px;
    text-align: left;
    border: 1px solid #2e3a55;
    border-radius: 5px;
    background: #131b2c;
}

.preview-data dt {
    margin-bottom: 2px;
    color: #7e8eaa;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.preview-data dd {
    margin: 0;
    overflow: hidden;
    color: #e7edf8;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-help {
    margin: 11px 0 0;
    color: #7887a2;
    font-size: 11px;
    line-height: 1.4;
}

/* BINDER LISTA */
.pokebinders-binder-list {
    display: block;
    padding: 8px 12px 28px;
    overflow-y: auto;
}

.pokebinders-binder-list:not(.has-binders) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.binder-era-section {
    width: 100%;
    margin: 0 0 16px;
}

.binder-era-heading {
    margin: 0 0 8px;
    padding: 7px 10px 9px;
    color: #ffdd4a;
    border-bottom: 1px solid #2f3a54;
    font-size: 18px;
    font-weight: 750;
}

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

.binder-tile {
    min-height: 176px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: inherit;
    text-decoration: none;
    border: 1px solid #33405d;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0)), #181f31;
    box-shadow: 0 6px 16px rgba(0,0,0,.17), inset 0 1px 0 rgba(255,255,255,.04);
    transition: border-color .12s ease, transform .12s ease, background .12s ease;
}

.binder-tile:hover {
    transform: translateY(-1px);
    border-color: #5974a1;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)), #1c263b;
}

.binder-tile-cover {
    width: min(100%, 286px);
    height: 88px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #485875;
    border-radius: 5px 11px 11px 5px;
    background: linear-gradient(135deg, #2b3b5c, #182238);
}

.binder-tile-spine {
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #5b6b87;
}

.binder-tile-name {
    max-width: 225px;
    padding: 0 12px;
    color: #fff;
    text-align: center;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.2;
}

.binder-tile-progress {
    margin-top: 8px;
    color: #eef3fb;
    font-size: 13px;
    font-weight: 700;
}

.binder-tile-progress span { color: #6f809f; }

.binder-tile-year {
    margin-top: 4px;
    color: #b0caeb;
    font-size: 12px;
    font-weight: 650;
}

/* BINDER DETTAGLIO */
.binder-detail-shell {
    min-height: calc(100vh - 165px);
    display: flex;
    flex-direction: column;
}

.binder-detail-toolbar {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr minmax(300px, auto);
}

.binder-detail-left-tools,
.binder-detail-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.binder-detail-tools { justify-content: flex-end; }

.binder-back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.binder-spread-wrap {
    flex: 1;
    min-height: 620px;
    padding: 14px 8px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.binder-spread {
    width: min(100%, 1450px);
    min-width: 980px;
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: stretch;
    filter: drop-shadow(0 20px 25px rgba(0,0,0,.27));
}

.binder-page {
    padding: 18px;
    position: relative;
    border: 1px solid #35445f;
    background:
        radial-gradient(circle at 35% 20%, rgba(255,255,255,.035), transparent 32%),
        #182136;
}

.binder-page-left { border-radius: 13px 3px 3px 13px; }
.binder-page-right { border-radius: 3px 13px 13px 3px; }

.binder-spine {
    position: relative;
    background: linear-gradient(90deg, #0b1020, #26324a 46%, #11192a 54%, #090e19);
    border-top: 1px solid #39445b;
    border-bottom: 1px solid #39445b;
}

.binder-spine span {
    position: absolute;
    left: 7px;
    width: 20px;
    height: 10px;
    border: 2px solid #77849c;
    border-radius: 50%;
    background: #141d2f;
}

.binder-spine span:nth-child(1) { top: 12%; }
.binder-spine span:nth-child(2) { top: 37%; }
.binder-spine span:nth-child(3) { top: 62%; }
.binder-spine span:nth-child(4) { top: 87%; }

.binder-frontispiece-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.binder-frontispiece {
    max-width: 470px;
    text-align: center;
}

.frontispiece-kicker {
    color: #7fa8e8;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
}

.binder-frontispiece h1 {
    margin: 12px 0 16px;
    color: #fff;
    font-size: clamp(28px, 3vw, 48px);
    line-height: 1.05;
}

.frontispiece-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.frontispiece-meta span {
    padding: 5px 8px;
    color: #b9c6db;
    border: 1px solid #35445f;
    border-radius: 999px;
    background: #11192a;
    font-size: 12px;
}

.frontispiece-progress {
    margin-top: 26px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
}

.frontispiece-progress strong {
    color: #fff;
    font-size: 25px;
}

.frontispiece-progress span {
    color: #f5cd49;
    font-size: 18px;
    font-weight: 800;
}

.binder-page-grid {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.binder-slot {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #3d4b65;
    border-radius: 7px;
    background: #101827;
}

.binder-slot.missing {
    opacity: .58;
    filter: saturate(.62);
}

.binder-slot.owned {
    border-color: #5474a5;
}

.binder-slot-empty {
    opacity: .28;
    border-style: dashed;
}

.binder-card-image-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: #0e1522;
}

.binder-card-image-shell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.binder-card-fallback {
    width: 100%;
    height: 100%;
    min-height: 100px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #71809c;
    text-align: center;
    border: 1px dashed #344158;
    border-radius: 4px;
}

.binder-card-fallback strong { color: #aab9d1; }
.binder-card-fallback span { font-size: 11px; line-height: 1.25; }

.binder-slot-caption {
    min-height: 46px;
    padding: 5px 7px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 6px;
    background: #172135;
    border-top: 1px solid #34415a;
    font-size: 10px;
}

.binder-slot-caption > span { color: #9eacc4; }
.binder-slot-caption > strong {
    min-width: 0;
    overflow: hidden;
    color: #f1f4fa;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.binder-slot-caption small {
    grid-column: 1 / -1;
    color: #dfc95d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.binder-owned-mark {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d8ffe8;
    border: 1px solid #3f7e59;
    border-radius: 50%;
    background: rgba(27,80,50,.88);
    font-size: 13px;
    font-weight: 900;
}

.binder-navigation {
    min-height: 68px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 60px auto 1fr 60px;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #29354d;
}

.binder-nav-arrow {
    width: 52px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
}

.binder-nav-arrow.disabled {
    opacity: .35;
    cursor: default;
}

.binder-jump-form {
    display: flex;
    align-items: center;
    gap: 7px;
}

.binder-jump-form label { margin: 0; }
.binder-jump-form input {
    width: 64px;
    min-height: 34px;
    padding: 5px;
    color: #fff;
    text-align: center;
    border: 1px solid #46536f;
    border-radius: 3px;
    background: #121829;
}

.binder-page-status {
    color: #f5cd49;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.binder-page-status span { color: #72809b; }

@media (max-width: 1100px) {
    .pokebinders-explore { grid-template-columns: minmax(0, 1fr) 330px; }
    .pokebinders-detail { height: 580px; min-height: 500px; }
    .preview-image-shell { height: 330px; }
}

@media (max-width: 900px) {
    .pokebinders-explore { grid-template-columns: 1fr; }
    .pokebinders-detail {
        position: static;
        width: 100%;
        height: auto;
        min-height: 480px;
    }
    .preview-image-shell { height: 350px; }
    .binder-detail-toolbar { grid-template-columns: 1fr; gap: 8px; }
    .binder-detail-tools { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 760px) {
    .header-right {
        width: 100%;
        align-items: center;
    }
    .header-right .account-area {
        margin-top: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .header-right .header-status {
        display: flex !important;
        margin-top: 0;
        margin-left: auto;
    }
    .pokebinders-table-panel { height: 470px; min-height: 470px; }
    .binder-era-grid { grid-template-columns: 1fr; }
    .binder-spread-wrap { justify-content: flex-start; }
    .binder-navigation { grid-template-columns: 52px 1fr 52px; }
    .binder-jump-form { display: none; }
    .binder-page-status { grid-column: 2; grid-row: 1; }
}
