/*
 * album.css — ALBUM page (route /album, js/pages/album.js).
 * 2026-09-10 redesign to a left chapter-rail + right card-grid layout
 * (per a user reference screenshot): compact rarity-framed cards with an
 * orb icon + colored name banner + an "N/M materials" bar, opening a
 * detail modal on click. Kept DEEPCORE's cream-on-tan palette; the
 * reference's rarity idea maps to a per-chapter frame colour (--tier).
 */

.alb2-wrap {
    position: relative; z-index: 2; flex: 1; min-height: 0;
    display: flex; gap: 14px; padding: 14px 18px;
}

/* ── Left chapter rail ──────────────────────────────────────────────── */
.alb2-nav {
    flex: 0 0 208px; display: flex; flex-direction: column; min-height: 0;
    background: rgba(255,248,236,.5);
    border: 1px solid rgba(58,36,16,.16); border-radius: 12px;
    padding: 12px 10px;
}
.alb2-nav-head {
    font-size: 13px; font-weight: 800; letter-spacing: 1px; color: #2c1a08;
    padding: 2px 6px 10px; border-bottom: 1px solid rgba(58,36,16,.14); margin-bottom: 8px;
}
.alb2-nav-head span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px; color: #8a6a48; margin-top: 3px; }
.alb2-nav-list { flex: 1; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 3px; }
.alb2-nav-list::-webkit-scrollbar { display: none; }

.alb2-nav-item {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 8px 8px 8px 10px; border-radius: 9px; cursor: pointer;
    transition: background .12s;
}
.alb2-nav-item::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    border-radius: 3px; background: var(--tier, #c8641a); opacity: 0; transition: opacity .12s;
}
.alb2-nav-item:hover { background: rgba(58,36,16,.06); }
.alb2-nav-item.active { background: rgba(200,100,26,.14); }
.alb2-nav-item.active::before { opacity: 1; }
.alb2-nav-ic { font-size: 16px; flex-shrink: 0; }
.alb2-nav-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.alb2-nav-title { font-size: 12px; font-weight: 700; color: #2c1a08; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb2-nav-track { height: 3px; border-radius: 2px; background: rgba(58,36,16,.14); overflow: hidden; }
.alb2-nav-fill { display: block; height: 100%; background: var(--tier, #c8641a); border-radius: 2px; }
.alb2-nav-count { font-size: 10.5px; font-weight: 700; font-family: var(--font-mono); color: #8a6a48; flex-shrink: 0; }
.alb2-nav-dot {
    position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
    background: #f0883e; box-shadow: 0 0 0 2px rgba(240,136,62,.35);
    animation: alb2-pulse 1.4s ease-in-out infinite;
}
@keyframes alb2-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .6; } }

/* ── Right stage ────────────────────────────────────────────────────── */
.alb2-stage {
    flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0;
    background: rgba(255,248,236,.5);
    border: 1px solid rgba(58,36,16,.16); border-radius: 12px;
    padding: 14px 16px;
}

.alb2-stage-head {
    flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
    padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgba(58,36,16,.15);
}
.alb2-stage-title { display: flex; align-items: center; gap: 10px; }
.alb2-stage-ic {
    font-size: 20px; width: 38px; height: 38px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; background: color-mix(in srgb, var(--tier) 16%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--tier) 45%, transparent);
}
.alb2-stage-name { font-size: 14px; font-weight: 800; color: #2c1a08; }
.alb2-stage-sub { display: block; font-size: 11px; color: #8a6a48; margin-top: 1px; }
.alb2-stage-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.alb2-stage-count { font-size: 11.5px; color: #8a6a48; letter-spacing: .5px; }
.alb2-stage-count b { color: #2c1a08; font-family: var(--font-mono); }

.alb2-filters { display: flex; gap: 3px; background: rgba(58,36,16,.07); border-radius: 8px; padding: 2px; }
.alb2-filter {
    border: none; background: transparent; cursor: pointer;
    font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #8a6a48;
    padding: 5px 9px; border-radius: 6px; transition: background .12s, color .12s;
}
.alb2-filter.active { background: #fff8ec; color: #c8641a; box-shadow: 0 1px 3px rgba(58,36,16,.15); }
.alb2-filter b { color: #c8641a; }
.alb2-filter.active b { color: #a3521a; }

.alb2-claim-all {
    border: none; cursor: pointer;
    background: linear-gradient(180deg,#f0883e,#c8641a); color: #fff8ec;
    font-size: 11px; font-weight: 800; letter-spacing: 1px;
    padding: 7px 12px; border-radius: 8px; transition: filter .12s;
}
.alb2-claim-all:hover:not(:disabled) { filter: brightness(1.07); }
.alb2-claim-all:disabled { opacity: .55; cursor: default; }

/* ── Card grid ──────────────────────────────────────────────────────── */
.alb2-grid {
    flex: 1; overflow-y: auto; scrollbar-width: none;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 12px 10px; align-content: start;
}
.alb2-grid::-webkit-scrollbar { display: none; }
.alb2-empty { grid-column: 1/-1; text-align: center; padding: 50px 0; color: rgba(138,106,72,.6); font-size: 12.5px; letter-spacing: 1px; }

.alb2-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.alb2-card:hover .alb2-frame { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(58,36,16,.2); }

.alb2-frame {
    position: relative; border-radius: 14px; padding: 12px 8px 0;
    border: 2.5px solid var(--tier, #c8641a);
    background: linear-gradient(180deg, #fffdf8, color-mix(in srgb, var(--tier) 9%, #fffdf8));
    overflow: hidden; transition: transform .14s, box-shadow .14s;
}
.alb2-card.done .alb2-frame { border-color: #3fb950; background: linear-gradient(180deg,#fbfff9,#eefaef); }
.alb2-card.claimable .alb2-frame { animation: alb2-glow 1.6s ease-in-out infinite; }
@keyframes alb2-glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(240,136,62,0); }
    50%     { box-shadow: 0 0 0 4px rgba(240,136,62,.28); }
}

.alb2-badge {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    font-size: 9px; font-weight: 800; letter-spacing: .5px;
    padding: 2px 6px; border-radius: 5px; color: #fff8ec;
}
.alb2-badge.claim { background: linear-gradient(180deg,#f0883e,#c8641a); }
.alb2-badge.done  { background: #3fb950; padding: 2px 5px; }

.alb2-orb {
    width: 62px; height: 62px; margin: 2px auto 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 26px;
    background: radial-gradient(circle at 50% 35%, #ffe6c2, #f6c98a 70%, #e0a860);
    border: 3px solid #fff8ec;
    box-shadow: 0 3px 10px rgba(58,36,16,.25), inset 0 0 12px rgba(255,255,255,.5);
}
.alb2-card.done .alb2-orb { filter: saturate(.7); }

.alb2-name {
    background: var(--tier, #c8641a); color: #fff8ec;
    font-size: 11px; font-weight: 800; letter-spacing: .3px; text-align: center;
    line-height: 1.25; padding: 5px 6px; margin: 0 -8px;
}
.alb2-card.done .alb2-name { background: #3fb950; }

.alb2-bar { display: flex; align-items: center; gap: 5px; padding: 0 2px; }
.alb2-bar-ic {
    width: 12px; height: 12px; flex-shrink: 0;
    background-image: url('../bg/coin.png'); background-size: contain; background-repeat: no-repeat; background-position: center;
}
.alb2-bar-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(58,36,16,.16); overflow: hidden; }
.alb2-bar-fill { display: block; height: 100%; background: linear-gradient(90deg,#f0883e,#ffc078); border-radius: 3px; }
.alb2-card.done .alb2-bar-fill { background: linear-gradient(90deg,#2b8a3e,#3fb950); }
.alb2-bar-txt { font-size: 10px; font-weight: 800; font-family: var(--font-mono); color: #8a6a48; flex-shrink: 0; }

/* ── Detail modal ───────────────────────────────────────────────────── */
.alb2-modal-layer:empty { display: none; }
.alb2-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(20,10,4,.6);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.alb2-modal {
    position: relative; width: 100%; max-width: 400px; max-height: 84vh; overflow-y: auto;
    scrollbar-width: none;
    background: linear-gradient(180deg,#fffdf8,#fbf3e6);
    border: 2px solid var(--tier, #c8641a); border-radius: 16px;
    padding: 18px 18px 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.alb2-modal::-webkit-scrollbar { display: none; }
.alb2-modal-x {
    position: absolute; top: 10px; right: 12px; cursor: pointer;
    font-size: 13px; color: #8a6a48; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.alb2-modal-x:hover { background: rgba(58,36,16,.1); color: #2c1a08; }

.alb2-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.alb2-orb.big { width: 54px; height: 54px; font-size: 24px; margin: 0; }
.alb2-modal-title { font-size: 15px; font-weight: 800; color: #2c1a08; }
.alb2-modal-sub { font-size: 11.5px; color: #8a6a48; margin-top: 2px; }

.alb2-modal-lbl {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 10px; letter-spacing: 1.5px; font-weight: 700; color: #8a6a48;
    margin: 12px 0 7px;
}
.alb2-modal-lbl span { font-family: var(--font-mono); color: #2c1a08; letter-spacing: 0; }

.alb2-mreqs { display: flex; flex-direction: column; gap: 5px; }
.alb2-mreq {
    display: flex; align-items: center; gap: 8px;
    background: rgba(58,36,16,.05); border: 1px solid rgba(58,36,16,.1);
    border-radius: 8px; padding: 6px 8px;
}
.alb2-mreq.met { background: rgba(43,138,62,.1); border-color: rgba(43,138,62,.28); }
.alb2-mreq-ic { font-size: 15px; flex-shrink: 0; }
.alb2-mreq-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alb2-mreq-name { font-size: 11.5px; font-weight: 700; color: #2c1a08; display: flex; align-items: center; gap: 5px; }
.alb2-mreq-grade { font-size: 8px; font-weight: 800; color: #fff8ec; padding: 1px 4px; border-radius: 3px; }
.alb2-mreq-track { height: 3px; border-radius: 2px; background: rgba(58,36,16,.14); overflow: hidden; }
.alb2-mreq-fill { display: block; height: 100%; border-radius: 2px; }
.alb2-mreq-num { font-size: 11px; font-weight: 800; font-family: var(--font-mono); color: #6b4520; flex-shrink: 0; }
.alb2-mreq-chk { width: 12px; flex-shrink: 0; color: #2b8a3e; font-weight: 800; font-size: 12.5px; }

.alb2-rewards { display: flex; flex-wrap: wrap; gap: 5px; }
.alb2-reward {
    display: flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 700; font-family: var(--font-mono);
    background: rgba(200,100,26,.12); color: #a3521a;
    border: 1px solid rgba(200,100,26,.28); border-radius: 6px; padding: 3px 8px;
}
.alb2-reward span { font-size: 12px; }
.alb2-reward b { font-family: var(--font-title); font-weight: 700; }

.alb2-modal-foot { margin-top: 16px; }
.alb2-modal-state { text-align: center; font-size: 11.5px; font-weight: 700; color: #8a6a48; padding: 8px; }
.alb2-modal-state.done { color: #2b8a3e; }
.alb2-modal-claim {
    width: 100%; padding: 11px; border: none; border-radius: 9px; cursor: pointer;
    background: linear-gradient(180deg,#f0883e,#c8641a); color: #fff8ec;
    font-size: 12px; font-weight: 800; letter-spacing: 2px; transition: filter .12s;
}
.alb2-modal-claim:hover:not(:disabled) { filter: brightness(1.07); }
.alb2-modal-claim:disabled { opacity: .55; cursor: default; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@container (max-width: 820px) {
    .alb2-wrap { flex-direction: column; padding: 10px 12px; gap: 10px; }
    .alb2-nav { flex: 0 0 auto; max-height: 40vh; }
    .alb2-nav-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
    .alb2-nav-item { flex: 0 0 150px; }
    .alb2-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
