/* =========================================================
   SCORCHED DIVIDE — Commander level, Challenge battles, Supply Depot, rewards
   The Depot reuses the Barracks frame (.bk-modal / .bk-panel / .bk-top).
   ========================================================= */

/* ---------- Home: commander level in the profile bar ---------- */
.mm-cmd {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-right: 18px;
    border-right: 1px solid var(--line, rgba(232, 226, 212, 0.14));
}

.mm-cmd-lv {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    padding: 4px 9px 3px;
    border-radius: 4px;
    background: #f2a900;
    color: #1a1406;
    font-family: 'Barlow Condensed', 'Chakra Petch', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    line-height: 1;
}

.mm-cmd-lv b { font-size: 22px; }

.mm-cmd-meta { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.mm-cmd-label { font-size: 12px; color: var(--haze, #98a2ac); white-space: nowrap; }
.mm-cmd-track { display: block; height: 5px; border-radius: 3px; background: rgba(232, 226, 212, 0.14); overflow: hidden; }
.mm-cmd-track i { display: block; height: 100%; width: 0; background: #f2a900; transition: width 0.4s; }
.mm-cmd-xp { font-size: 12px; color: var(--bone, #e8e2d4); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Home: Depot button ---------- */
.mm-depot {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    min-height: 40px;
    padding: 0 14px 0 6px;
    border: 1px solid rgba(232, 226, 212, 0.28);
    border-radius: 4px;
    background: rgba(232, 226, 212, 0.06);
    color: var(--bone, #e8e2d4);
    font-family: 'Barlow Condensed', 'Chakra Petch', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
}

.mm-depot:hover { border-color: #f2a900; }
.mm-depot:focus-visible { outline: 2px solid #e8e2d4; outline-offset: 2px; }
.mm-depot-ico { width: 32px; height: 32px; object-fit: contain; margin: -4px 0; }

.mm-depot-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #2ecc71;
    color: #08130c;
    font: 700 12px/20px 'Barlow', system-ui, sans-serif;
    text-align: center;
}

.mm-depot-badge[hidden] { display: none; }

/* ---------- Home: Challenge options ---------- */
.mm-challenge-opts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: -8px;
}

.mm-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 14px;
    color: var(--bone, #e8e2d4);
    cursor: pointer;
    touch-action: manipulation;
}

.mm-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #f2a900;
    cursor: pointer;
}

.mm-check input:disabled + span { opacity: 0.55; }
/* The explanation shows once Challenge is ticked (the opponent card explains it too) */
.mm-challenge input:not(:checked) + span small { display: none; }
.mm-check b { display: block; line-height: 1.1; font-family: 'Barlow Condensed', 'Chakra Petch', 'Arial Narrow', sans-serif; font-size: 17px; text-transform: uppercase; letter-spacing: 0.02em; }
.mm-check small { display: block; font-size: 13px; line-height: 1.35; color: var(--haze, #98a2ac); }

/* Accepting challenges only matters for online matches */
#main-menu:not([data-mode="online"]) .mm-accept { display: none; }

.mm-intel.is-challenge { border-color: rgba(242, 169, 0, 0.6); box-shadow: inset 0 0 0 1px rgba(242, 169, 0, 0.25); }

/* ---------- Post-match rewards ---------- */
.pm-rewards {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(242, 169, 0, 0.35);
    border-radius: 6px;
    background: rgba(242, 169, 0, 0.06);
    color: #e8e2d4;
    text-align: left;
}

.pm-rewards[hidden] { display: none; }

.pm-challenge { margin: 0 0 8px; font-weight: 700; color: #f2a900; }

.pm-rw-row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }

.pm-rw { display: inline-flex; align-items: center; gap: 7px; }
.pm-rw img { width: 34px; height: 34px; object-fit: contain; }
.pm-rw b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pm-rw small { color: #98a2ac; font-size: 13px; }
.pm-rw-ico {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: #f2a900; color: #1a1406; font: 800 12px/1 'Barlow', system-ui, sans-serif;
}

.pm-levelup-cmd { margin: 10px 0 0; font-weight: 700; color: #6fe3a0; }

.pm-cmd-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: #98a2ac; }
.pm-cmd-track { flex: 1; height: 6px; border-radius: 3px; background: rgba(232, 226, 212, 0.14); overflow: hidden; }
.pm-cmd-track i { display: block; height: 100%; background: #f2a900; }

.pm-rw-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.pm-rw-actions:empty { display: none; }

/* ---------- Shared buttons ---------- */
.eco-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(232, 226, 212, 0.28);
    border-radius: 6px;
    background: #1b2530;
    color: #e8e2d4;
    font: 600 15px/1.15 'Barlow', 'Chakra Petch', system-ui, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
}

.eco-btn small { display: block; margin-left: 6px; font-size: 12px; font-weight: 500; opacity: 0.75; }
.eco-btn img { width: 22px; height: 22px; object-fit: contain; }
.eco-btn:hover:not(:disabled) { border-color: #e8e2d4; }
.eco-btn:focus-visible { outline: 2px solid #f2a900; outline-offset: 2px; }
.eco-btn:disabled { opacity: 0.45; cursor: default; }
.eco-primary { border-color: #f2a900; background: #f2a900; color: #1a1406; }
.eco-primary:hover:not(:disabled) { background: #ffbb24; border-color: #ffbb24; }
.eco-btn.done { border-color: rgba(46, 204, 113, 0.5); background: rgba(46, 204, 113, 0.12); color: #6fe3a0; }

/* ---------- Supply Depot ---------- */
.dp-modal { z-index: 520; }   /* above the post-match screen (500) */
.dp-panel { width: min(1000px, 100%); position: relative; }
.dp-wallet-ico { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }

.dp-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 22px 0;
    border-bottom: 1px solid var(--line);
}

.dp-tab {
    padding: 10px 16px 9px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--haze);
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
}

.dp-tab.active { color: var(--bone); border-bottom-color: var(--amber); }
.dp-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

.dp-body { padding: 16px 22px 20px; overflow-y: auto; }
.dp-body section[hidden] { display: none; }

.dp-chests {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.dp-chest {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.dp-chest-img { width: 100%; height: 150px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }

.dp-chest h3 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: 24px;
    text-transform: uppercase;
}

.dp-blurb { margin: 0; font-size: 14px; color: var(--haze); line-height: 1.4; min-height: 2.8em; }

.dp-odds { font-size: 13px; color: var(--haze); }
.dp-odds summary { cursor: pointer; color: var(--bone); padding: 4px 0; }
.dp-odds ul { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dp-odds li { display: flex; justify-content: space-between; gap: 10px; }
.dp-odds li b { color: var(--bone); white-space: nowrap; }
.dp-odds p { margin: 6px 0 0; }

.dp-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.dp-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 12px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--panel);
    color: var(--bone);
    cursor: pointer;
    font-family: var(--body);
}

.dp-pack:hover { border-color: var(--amber); }
.dp-pack:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.dp-pack img { width: 96px; height: 96px; object-fit: contain; }
.dp-pack b { font-family: var(--display); font-size: 30px; line-height: 1; }
.dp-pack em { font-style: normal; font-size: 13px; color: #6fe3a0; min-height: 1.2em; }
.dp-price {
    margin-top: 8px;
    width: 100%;
    padding: 9px 0;
    border-radius: 5px;
    background: var(--amber);
    color: #1a1406;
    font-weight: 700;
    font-size: 17px;
}

.dp-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    background: #2ecc71;
    color: #08130c;
    font-size: 12px;
    font-weight: 700;
}

.dp-fine { margin: 14px 0 0; font-size: 13px; color: var(--haze); line-height: 1.45; }
.dp-fine:empty { display: none; }

.dp-confirm {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--amber);
    border-radius: 6px;
    background: rgba(242, 169, 0, 0.08);
}

.dp-confirm[hidden] { display: none; }
.dp-confirm p { margin: 0 0 12px; line-height: 1.45; }
.dp-confirm-actions { display: flex; gap: 8px; }

.dp-status { margin: 12px 0 0; min-height: 1.2em; font-size: 14px; color: #6fe3a0; }
.dp-status:empty { display: none; }
.dp-status.eco-error { color: #ff8a8a; }

/* Chest opening */
.dp-reveal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 11, 15, 0.92);
    z-index: 2;
}

.dp-reveal[hidden] { display: none; }

.dp-reveal-box {
    width: min(440px, 100%);
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.dp-reveal-chest { width: 170px; height: 150px; object-fit: contain; animation: dp-pop 0.7s cubic-bezier(0.2, 0.9, 0.2, 1.2); }
.dp-reveal-box h3 { margin: 0; font-family: var(--display); font-size: 28px; text-transform: uppercase; }
.dp-reveal-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.dp-reveal-list li {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    text-align: left;
    animation: dp-in 0.4s both;
}

.dp-reveal-list li:nth-child(2) { animation-delay: 0.15s; }
.dp-reveal-list li:nth-child(3) { animation-delay: 0.3s; }
.dp-reveal-list li:nth-child(4) { animation-delay: 0.45s; }
.dp-reveal-list img, .dp-cos { grid-row: span 2; width: 44px; height: 44px; object-fit: contain; font-size: 30px; text-align: center; line-height: 44px; }
.dp-reveal-list b { font-size: 17px; }
.dp-reveal-list small { color: var(--haze); font-size: 13px; }

@keyframes dp-pop {
    0% { transform: scale(0.6) rotate(-6deg); opacity: 0; }
    60% { transform: scale(1.08) rotate(3deg); opacity: 1; }
    100% { transform: none; }
}

@keyframes dp-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Test-mode ad */
.eco-test-ad {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.9);
    color: #e8e2d4;
    font-family: 'Barlow', system-ui, sans-serif;
}

.eco-test-ad-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.eco-test-ad-box b { font-size: 28px; }
.eco-test-ad-box em { font-style: normal; font-size: 56px; font-weight: 800; color: #f2a900; }

/* ---------- Phones ---------- */
@media (max-height: 500px), (max-width: 640px) {
    .mm-cmd { padding-right: 10px; gap: 7px; }
    .mm-cmd-meta { min-width: 84px; }
    .mm-cmd-label { display: none; }
    .mm-depot { min-height: 32px; font-size: 14px; padding: 0 6px; }
    .mm-depot > span:not(.mm-depot-badge) { display: none; }      /* icon only */
    #btn-account #account-chip-text { display: none; }
    #btn-account { padding: 0 9px; }
    .mm-stats div:first-child { display: none; }                   /* record; win/loss still on the post-match screen */
    .mm-depot-ico { width: 26px; height: 26px; }
    .mm-check small { display: none; }
    .dp-tabs, .dp-body { padding-left: 14px; padding-right: 14px; }
    .dp-chest-img { height: 100px; }
    .dp-pack img { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .dp-reveal-chest, .dp-reveal-list li { animation: none; }
}
.pm-crate-note { margin: 8px 0 0; text-align: center; font-size: 13px; color: #98a2ac; }
