/* =====================
   SIDEBAR SHELL (mirrors the Stats & Strats page)
   ===================== */

.deck-shell {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    text-align: left;
}

/* ── Sidebar rail ───────────────────────────────── */
.deck-sidebar {
    position: sticky;
    top: 140px; /* below fixed header (70) + action bar (70) */
    flex: 0 0 230px;
    height: calc(100vh - 242px);
    overflow-y: auto;
    background: rgba(8, 8, 8, 0.82);
    border: 1px solid rgba(255, 191, 0, 0.12);
    border-radius: 14px;
    margin: 16px 0 16px 16px;
    padding: 14px 10px 18px;
    box-sizing: border-box;
    scrollbar-width: thin;
}

/* main.css sets a global `nav { display:flex; justify-content:center }` for the
   header — override it so the rail stacks vertically. */
.deck-nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
}

.deck-nav-group {
    margin-bottom: 6px;
}

.deck-nav-group-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(240, 236, 230, 0.32);
    padding: 14px 12px 6px;
}

/* Prominent "Build New Deck" call to action at the top of the rail */
.deck-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: auto;
    background: rgba(255, 191, 0, 0.18);
    border: 1px solid rgba(255, 191, 0, 0.45);
    border-radius: 9px;
    color: #ffbf00;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 11px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.deck-new-btn:hover:not(:disabled) {
    background: rgba(255, 191, 0, 0.3);
    border-color: rgba(255, 191, 0, 0.7);
    box-shadow: 0 0 14px rgba(255, 191, 0, 0.22);
    transform: none;
}

.deck-new-btn:disabled,
.deck-new-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.deck-new-btn > i { font-size: 0.7rem; }

/* ── Sidebar nav items ──────────────────────────── */
.deck-tab {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 10px 12px;
    color: rgba(240, 236, 230, 0.55);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    transition: background 0.2s, color 0.2s;
}

.deck-tab > i:first-child {
    width: 18px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 191, 0, 0.45);
    flex-shrink: 0;
    transition: color 0.2s;
}

.deck-tab > span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-tab:hover {
    color: rgba(240, 236, 230, 0.9);
    background: rgba(255, 255, 255, 0.04);
    transform: none;
    box-shadow: none;
}

.deck-tab.active {
    background: rgba(255, 191, 0, 0.13);
    color: #ffbf00;
}

.deck-tab.active > i:first-child { color: #ffbf00; }

/* Bright x/allowed slot count pill next to each game type */
.deck-tab > .deck-tab-count {
    /* higher specificity than ".deck-tab > span" so the badge does NOT inherit
       flex:1 — otherwise it grabs half the row and ellipsizes the label */
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255, 191, 0, 0.16);
    border: 1px solid rgba(255, 191, 0, 0.4);
    color: #ffd54a;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-shadow: 0 0 8px rgba(255, 191, 0, 0.5);
}

.deck-tab-count:empty { display: none; }

.deck-tab-count.at-limit {
    background: rgba(255, 120, 80, 0.18);
    border-color: rgba(255, 120, 80, 0.5);
    color: #ff9d7a;
    text-shadow: 0 0 8px rgba(255, 120, 80, 0.5);
}

/* Premium lock/crown badge on the Deck Doctor tab (reuses stats icon classes) */
.deck-tab-premium.stats-unlocked .stats-lock-icon { display: none; }
.deck-tab-premium.stats-unlocked .stats-crown-icon { display: inline-block; }

/* ── Content column + topbar ────────────────────── */
.deck-content-col {
    flex: 1;
    min-width: 0;
}

.deck-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px 0;
    max-width: 1240px;
    margin: 0 auto;
    box-sizing: border-box;
}

.deck-heading {
    font-family: 'DragonSlayer', serif;
    color: #ffbf00;
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin: 0;
    flex: 1;
    text-align: left;
    text-shadow: 0 0 14px rgba(255, 191, 0, 0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-body {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px 24px 80px;
    box-sizing: border-box;
}

.deck-panel { display: none; }
.deck-panel.active { display: block; }

.deck-slot-indicator {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.82rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: #ffd54a;
    text-shadow: 0 0 10px rgba(255, 191, 0, 0.45);
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 191, 0, 0.1);
    border: 1px solid rgba(255, 191, 0, 0.28);
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.deck-slot-indicator.at-limit {
    color: #ff9d7a;
    text-shadow: 0 0 10px rgba(255, 120, 80, 0.5);
    background: rgba(255, 120, 80, 0.12);
    border-color: rgba(255, 120, 80, 0.45);
}

/* "GET MORE" beside the slot count → store items that add deck slots */
.deck-get-more {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    white-space: nowrap;
    color: #0e0e0e;
    background: linear-gradient(135deg, #ffe27a, #ffb300 60%, #ff8a00);
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.35);
    transition: filter 0.18s, box-shadow 0.18s;
}

.deck-get-more:hover {
    color: #0e0e0e;
    filter: brightness(1.1);
    box-shadow: 0 0 18px rgba(255, 170, 0, 0.6);
}

.deck-get-more.at-limit { animation: deck-get-more-pulse 2.2s ease-in-out infinite; }

@keyframes deck-get-more-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 0, 0.35); }
    50% { box-shadow: 0 0 24px rgba(255, 170, 0, 0.85); }
}

/* ── My Decks tile grid ───────────────────────── */
.my-decks-list.deck-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.deck-grid-hint,
.deck-grid-divider { grid-column: 1 / -1; }

.deck-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 330px;
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
    background: linear-gradient(170deg, #17120c 0%, #0c0b0a 100%);
    border: 1px solid rgba(255, 191, 0, 0.14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.deck-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 191, 0, 0.4);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 150, 0, 0.12);
}

.deck-tile.active {
    border-color: rgba(255, 191, 0, 0.7);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 170, 0, 0.28);
}

.deck-tile.locked { opacity: 0.55; border-style: dashed; }
.deck-tile.locked:hover { opacity: 0.8; }

/* Art: the card fan on an ember backdrop. A button so the whole face opens the viewer. */
.deck-tile-art {
    position: relative;
    display: block;
    width: 100%;
    height: 200px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 80% at 50% 100%, rgba(255, 150, 30, 0.28), transparent 70%),
        linear-gradient(180deg, #221709 0%, #120d08 100%);
}

.deck-tile.active .deck-tile-art {
    background:
        radial-gradient(ellipse 80% 90% at 50% 100%, rgba(255, 180, 40, 0.45), transparent 72%),
        linear-gradient(180deg, #2c1d0a 0%, #150e07 100%);
}

.deck-tile-fan {
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 0;
    height: 0;
}

/* Each card pivots from below the tile; --i / --n spread them into a fan */
.deck-tile-card {
    position: absolute;
    left: -52px;
    bottom: 0;
    width: 104px;
    height: 146px;
    max-height: none; /* main.css img { max-height: 100% } is 0 inside the 0x0 fan box */
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    transform-origin: 50% 140%;
    transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 11deg));
    transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.15);
}

.deck-tile:hover .deck-tile-card {
    transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 15deg)) translateY(-8px);
}

.deck-tile-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 191, 0, 0.25);
    color: rgba(255, 191, 0, 0.4);
    font-size: 1.6rem;
    transform: none;
}

.deck-tile-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.62rem;
    font-weight: bold;
    letter-spacing: 0.16em;
}

.deck-tile-badge-active {
    color: #0e0e0e;
    background: linear-gradient(135deg, #ffe27a, #ffb300 60%, #ff8a00);
    box-shadow: 0 0 14px rgba(255, 170, 0, 0.55);
}

.deck-tile-badge-locked {
    color: #a89880;
    background: rgba(8, 8, 8, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.deck-tile-count {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 999px;
    box-sizing: border-box;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    text-align: center;
    color: #ffd54a;
    background: rgba(8, 8, 8, 0.75);
    border: 1px solid rgba(255, 191, 0, 0.35);
}

.deck-tile-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    padding: 14px 16px 16px;
}

.deck-tile-name {
    font-family: 'HwyGothic', sans-serif;
    font-size: 1.05rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    color: #f0ece6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-tile.active .deck-tile-name { color: #ffd54a; }

.deck-tile-meta {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    line-height: 1.4;
    color: rgba(240, 236, 230, 0.65);
}

.deck-tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
}

.deck-tile-btn {
    display: inline-flex;
    align-items: center;
    height: auto;
    margin: 0;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 191, 0, 0.25);
    background: rgba(255, 191, 0, 0.06);
    color: #e6d6b4;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.deck-tile-btn:hover {
    color: #ffbf00;
    border-color: rgba(255, 191, 0, 0.6);
    background: rgba(255, 191, 0, 0.14);
}

.deck-tile-btn-primary {
    color: #0e0e0e;
    border-color: transparent;
    background: linear-gradient(135deg, #ffd45e, #ffb300);
}

.deck-tile-btn-primary:hover { color: #0e0e0e; background: linear-gradient(135deg, #ffe27a, #ffc21a); }

.deck-tile-btn-icon { margin-left: auto; padding: 7px 10px; }
.deck-tile-btn-skin { padding: 7px 10px; }

/* The deck's skin (per-deck override, else the equipped DECK skin) as a small deck pile in the
   tile art's corner, the fan of its top cards beside it. */
.deck-tile-skin {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 62px;
    height: 87px;
    border-radius: 6px;
    box-shadow:
        2px 2px 0 rgba(20, 14, 8, 0.95), 3px 3px 0 rgba(255, 191, 0, 0.35),
        5px 5px 0 rgba(20, 14, 8, 0.95), 6px 6px 0 rgba(255, 191, 0, 0.25),
        0 10px 18px rgba(0, 0, 0, 0.6);
    transform: rotate(-4deg);
    z-index: 2;
}

.deck-tile-skin img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 6px;
    object-fit: cover;
}

.deck-tile-art.has-skin .deck-tile-fan { left: 56%; }

/* ── Deck skin picker modal ── */
.modal-card.deck-skin-card {
    position: relative;
    max-width: 640px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 60px);
    box-sizing: border-box;
    padding: 24px 20px 18px;
    gap: 6px;
}

.deck-skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 8px;
    overflow-y: auto;
}

.deck-skin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: auto;
    padding: 8px 6px 10px;
    border: 1px solid rgba(255, 191, 0, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #d8cfc4;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.deck-skin-option:hover { border-color: rgba(255, 191, 0, 0.55); background: rgba(255, 191, 0, 0.06); }
.deck-skin-option.selected { border-color: #ffbf00; background: rgba(255, 191, 0, 0.1); }

.deck-skin-option img,
.deck-skin-blank {
    width: 80px;
    height: 112px;
    max-height: none;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.deck-skin-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 191, 0, 0.3);
    color: rgba(255, 191, 0, 0.45);
    font-size: 1.4rem;
}

.deck-skin-name {
    font-size: 0.78rem;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

.deck-skin-tag {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffbf00;
}

.deck-skin-tag-dim { color: #8f8478; }

.deck-skin-empty {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    color: #a89c90;
    font-size: 0.88rem;
    text-align: center;
}

.deck-skin-empty a { color: #ffbf00; }

@media only screen and (max-width: 767px) {
    .deck-tile-skin { width: 52px; height: 73px; left: 10px; bottom: 10px; }
    .deck-skin-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
    .deck-skin-option img, .deck-skin-blank { width: 70px; height: 98px; }
}
.deck-tile-btn-delete:hover { color: #ff6b6b; border-color: rgba(255, 90, 90, 0.6); background: rgba(255, 70, 70, 0.1); }

/* Empty slot: a dashed outline that builds a deck */
.deck-tile.deck-tile-slot {
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: auto;
    margin: 0;
    padding: 20px;
    cursor: pointer;
    border: 2px dashed rgba(255, 191, 0, 0.28);
    background: rgba(10, 8, 6, 0.82); /* opaque enough to read over the page's space art */
    box-shadow: none;
}

.deck-tile.deck-tile-slot:hover { border-color: rgba(255, 191, 0, 0.6); background: rgba(255, 191, 0, 0.06); }

.deck-tile-slot-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 191, 0, 0.35);
    color: #ffbf00;
    font-size: 1.5rem;
    transition: transform 0.22s;
}

.deck-tile-slot:hover .deck-tile-slot-plus { transform: scale(1.1) rotate(90deg); }

.deck-tile-slot-label {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: rgba(240, 236, 230, 0.55);
}

.deck-tile-slot-cta {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.14em;
    color: #ffbf00;
}

/* "Need more decks?" → store deck-slot items */
.deck-tile.deck-tile-more {
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 20px;
    text-align: center;
    border-color: rgba(255, 191, 0, 0.35);
    background:
        radial-gradient(ellipse 80% 70% at 50% 0%, rgba(255, 180, 40, 0.22), transparent 70%),
        linear-gradient(170deg, #1d1409 0%, #0c0b0a 100%);
}

.deck-tile-more-icon {
    position: relative;
    font-size: 2.2rem;
    color: #ffbf00;
    filter: drop-shadow(0 0 12px rgba(255, 170, 0, 0.5));
}

.deck-tile-more-icon .fa-plus {
    position: absolute;
    right: -12px;
    bottom: -4px;
    font-size: 1rem;
    color: #0e0e0e;
    background: #ffbf00;
    border-radius: 50%;
    padding: 4px;
}

.deck-tile-more-title {
    font-family: 'DragonSlayer', serif;
    font-size: 1.25rem;
    letter-spacing: 2px;
    color: #ffd54a;
}

.deck-tile-more-body {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.74rem;
    line-height: 1.5;
    color: #a89880;
}

.deck-tile-more-cta {
    margin-top: 4px;
    padding: 9px 16px;
    border-radius: 999px;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.74rem;
    font-weight: bold;
    letter-spacing: 0.14em;
    color: #0e0e0e;
    background: linear-gradient(135deg, #ffe27a, #ffb300 60%, #ff8a00);
}

@media only screen and (max-width: 767px) {
    /* Heading on its own row so the slot count + GET MORE don't truncate it */
    .deck-topbar { flex-wrap: wrap; row-gap: 8px; }
    .deck-topbar .deck-heading { flex-basis: 100%; }
    .my-decks-list.deck-tile-grid { grid-template-columns: 1fr; gap: 14px; }
    .deck-tile { min-height: 0; }
    .deck-tile-art { height: 170px; }
    .deck-tile-card { width: 90px; height: 126px; left: -45px; }
    .deck-tile.deck-tile-slot, .deck-tile.deck-tile-more { min-height: 180px; }
}

/* ── Builder workbench bar (sticky: name, game type, progress, save) ── */
.bld-bar {
    position: sticky;
    top: 148px; /* fixed header (70) + action bar (70) + a little air */
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: rgba(16, 13, 10, 0.97);
    border: 1px solid rgba(255, 191, 0, 0.22);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
}

.builder-back-btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: rgba(240, 236, 230, 0.88);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 1px;
    padding: 10px 14px;
    cursor: pointer;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.builder-back-btn:hover {
    background: rgba(255, 191, 0, 0.12);
    border-color: rgba(255, 191, 0, 0.45);
    color: #ffbf00;
    transform: none;
    box-shadow: none;
}

.bld-name {
    flex: 1 1 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bld-name .form-label { font-size: 0.6rem; letter-spacing: 2px; color: rgba(240, 236, 230, 0.6); }

.form-input.bld-name-input {
    padding: 7px 12px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    color: #fff3d6;
    background: rgba(255, 255, 255, 0.05);
}

.bld-name .field-error { margin-top: 2px; }

.bld-bar .mode-toggle { flex: 0 0 auto; }
.bld-bar .mode-btn { padding: 9px 14px; }

.bld-progress {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.bld-progress .deck-slot-count {
    text-align: right;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
}

.bld-progress-track {
    display: block;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.bld-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8a00, #ffbf00);
    transition: width 0.25s ease, background 0.25s ease;
}

.bld-progress.full .bld-progress-fill { background: linear-gradient(90deg, #43a047, #81c784); }
.bld-progress.over .bld-progress-fill { background: #ef5350; }
.bld-progress.over .deck-slot-count { color: #ef5350; }

.bld-bar .submit-btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 12px 22px;
    white-space: nowrap;
}

#panel-build > .response-message { margin: 0 0 14px; }

/* Mid widths: the back button keeps its icon (and title) only, so the name keeps room */
@media only screen and (max-width: 1280px) {
    .builder-back-btn > span { display: none; }
    .bld-progress { flex-basis: 110px; }
}

.my-decks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.decks-loading,
.no-decks-hint {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.8rem;
    color: rgba(240, 236, 230, 0.65);
    letter-spacing: 0.06em;
    padding: 6px 0;
    margin: 0;
}

.my-deck-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(14, 14, 14, 0.85);
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: 10px;
    padding: 14px 18px;
    transition: border-color 0.18s ease;
}

.my-deck-card.active {
    border-color: rgba(255, 191, 0, 0.35);
}

.my-deck-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.my-deck-name {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.9rem;
    color: #e8e0d4;
    letter-spacing: 0.06em;
}

.my-deck-meta {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.65rem;
    color: #5a5248;
    letter-spacing: 0.08em;
}

.my-deck-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.my-deck-active-badge {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: #ffbf00;
    background: rgba(255, 191, 0, 0.1);
    border: 1px solid rgba(255, 191, 0, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
}

.my-deck-activate-btn {
    background: rgba(255, 191, 0, 0.08);
    border: 1px solid rgba(255, 191, 0, 0.3);
    border-radius: 6px;
    color: #a89880;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    cursor: pointer;
    height: auto;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.my-deck-activate-btn:hover:not(:disabled) {
    color: #ffbf00;
    border-color: rgba(255, 191, 0, 0.6);
    background: rgba(255, 191, 0, 0.16);
    transform: none;
    box-shadow: none;
}

.my-deck-activate-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── LOCKED (over the deck-slot limit) DECKS ─────── */

.deck-lock-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 2px 2px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 191, 0, 0.16);
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6a6258;
}

.deck-lock-divider i {
    color: #8a7638;
}

.my-deck-card.locked {
    opacity: 0.55;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(14, 14, 14, 0.6);
}

.my-deck-card.locked:hover {
    opacity: 0.75;
}

.my-deck-card.locked .my-deck-name {
    color: #9a9084;
}

.my-deck-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    color: #8a8078;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 10px;
}

.my-deck-locked-badge i {
    font-size: 0.58rem;
}

.deck-locked-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    color: #6a6258;
}

.deck-locked-note i {
    color: #8a7638;
}

/* ── DECK CONTENTS ACCORDION ───────────────────── */

.my-deck-wrapper {
    display: flex;
    flex-direction: column;
}

.my-deck-chevron {
    font-size: 0.7rem;
    color: #4a4540;
    transition: transform 0.32s ease, color 0.18s ease;
    margin-left: 4px;
    display: inline-block;
    line-height: 1;
}

.my-deck-card:hover .my-deck-chevron {
    color: #7a7068;
}

.my-deck-wrapper.expanded .my-deck-chevron {
    transform: rotate(180deg);
    color: #ffbf00;
}

.my-deck-wrapper.expanded .my-deck-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: rgba(255, 191, 0, 0.06);
}

.my-deck-contents {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease;
    background: rgba(8, 8, 8, 0.6);
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.my-deck-wrapper:not(.expanded) .my-deck-contents {
    border-color: transparent;
}

.deck-contents-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 14px;
    justify-content: flex-start;
}

.deck-contents-card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.deck-contents-card img {
    width: 70px;
    height: 98px;
    border-radius: 6px;
    display: block;
}

.deck-contents-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #ffbf00;
    color: #0e0e0e;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.6rem;
    font-weight: bold;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── DECK CONTENTS ACTIONS ────────────────────────── */

.deck-contents-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 14px 0;
}

.deck-edit-btn {
    background: rgba(255, 191, 0, 0.08);
    border: 1px solid rgba(255, 191, 0, 0.3);
    border-radius: 6px;
    color: #a89880;
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    cursor: pointer;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.deck-edit-btn:hover {
    color: #ffbf00;
    border-color: rgba(255, 191, 0, 0.6);
    background: rgba(255, 191, 0, 0.16);
    transform: none;
    box-shadow: none;
}

.deck-edit-btn i {
    font-size: 0.55rem;
}

/* ── MAKE ACTIVE CHECKBOX ───────────────────────── */

.make-active-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.make-active-row input[type="checkbox"] {
    accent-color: #ffbf00;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.make-active-row input[type="checkbox"]:disabled {
    cursor: default;
}

.make-active-label {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.78rem;
    color: rgba(240, 236, 230, 0.85);
    letter-spacing: 0.05em;
    cursor: pointer;
    margin: 0;
}

.make-active-row.locked .make-active-label {
    color: rgba(240, 236, 230, 0.45);
}

/* =====================
   BUILDER WORKBENCH
   Solid surfaces over the page art so every label reads; gold marks what is in
   the deck, green says the deck is complete, red is reserved for over / remove.
   ===================== */

.deck-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 16px;
    width: 100%;
    text-align: left;
}

.bld-surface {
    background: rgba(14, 12, 10, 0.95);
    border: 1px solid rgba(255, 191, 0, 0.14);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

/* =====================
   LEFT: CARD PICKER
   ===================== */

.card-picker-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
}

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

.picker-search-group {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 150px;
    min-width: 140px;
}

.picker-search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 191, 0, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #f0ece6;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.86rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.picker-search-input::placeholder { color: rgba(240, 236, 230, 0.45); }

.picker-search-input:focus {
    border-color: rgba(255, 191, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.12);
}

.picker-search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 191, 0, 0.6);
    font-size: 0.8rem;
    pointer-events: none;
}

.picker-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.picker-chip {
    height: 38px;
    margin: 0;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(240, 236, 230, 0.8);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.picker-chip:hover {
    color: #ffd54a;
    border-color: rgba(255, 191, 0, 0.45);
    transform: none;
    box-shadow: none;
}

.picker-chip.active {
    color: #0e0e0e;
    background: #ffbf00;
    border-color: #ffbf00;
}

.picker-sort {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.picker-sort > i {
    position: absolute;
    left: 11px;
    color: rgba(255, 191, 0, 0.7);
    font-size: 0.78rem;
    pointer-events: none;
}

.picker-sort select {
    height: 38px;
    padding: 0 12px 0 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #17140f;
    color: #f0ece6;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.picker-sort select:focus-visible { outline: 2px solid rgba(255, 191, 0, 0.6); outline-offset: 1px; }

/* =====================
   PICKER GRID
   ===================== */

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
    align-content: start;
    max-height: calc(100vh - 330px);
    min-height: 320px;
    overflow-y: auto;
    padding: 6px 6px 6px 2px;
    margin: -6px -6px -6px -2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 191, 0, 0.3) transparent;
}

.picker-grid::-webkit-scrollbar      { width: 6px; }
.picker-grid::-webkit-scrollbar-track { background: transparent; }
.picker-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 191, 0, 0.3);
    border-radius: 3px;
}

.picker-card {
    position: relative;
    cursor: pointer;
    border-radius: 9px;
    outline: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.picker-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    border-radius: 9px;
    pointer-events: none;
    transition: filter 0.15s ease;
}

.picker-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 191, 0, 0.45);
}

.picker-card:focus-visible { box-shadow: 0 0 0 3px #ffbf00; }

.picker-card.in-deck {
    box-shadow: 0 0 0 2px #ffbf00, 0 6px 18px rgba(255, 170, 0, 0.25);
}

.picker-card.in-deck:hover {
    box-shadow: 0 0 0 2px #ffd54a, 0 10px 24px rgba(255, 170, 0, 0.35);
}

/* Four copies: darkened (never see-through), still clickable to remove */
.picker-card.maxed { cursor: default; }
.picker-card.maxed img { filter: brightness(0.42) saturate(0.6); }
.picker-card.maxed:hover { transform: none; }

/* Copies in the deck: "2/4", only on cards that are in it */
.picker-card-count {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffbf00;
    color: #0e0e0e;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
    font-weight: bold;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.picker-card.in-deck .picker-card-count { display: block; }
.picker-card.maxed .picker-card-count { background: #81c784; }

/* Remove one copy: top-left, on hover (always shown on touch screens) */
.picker-card-minus {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(10, 8, 6, 0.88);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: background 0.15s, border-color 0.15s;
}

.picker-card.in-deck:hover .picker-card-minus { display: flex; }

.picker-card-minus:hover {
    background: #c62828;
    border-color: #ef5350;
    transform: none;
}

@media (hover: none) {
    .picker-card.in-deck .picker-card-minus { display: flex; }
}

@keyframes deckBump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.picker-card.bump { animation: deckBump 0.22s ease-out; }
.deck-preview-item.bump { animation: deckRowFlash 0.5s ease-out; }

@keyframes deckRowFlash {
    0%   { background: rgba(255, 191, 0, 0.28); }
    100% { background: rgba(255, 255, 255, 0.04); }
}

.picker-loading {
    grid-column: 1 / -1;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.8rem;
    color: rgba(240, 236, 230, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    padding: 48px 0;
    width: 100%;
}

.picker-hint {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    color: rgba(240, 236, 230, 0.6);
    letter-spacing: 0.06em;
    text-align: center;
    margin: 0;
}

/* =====================
   RIGHT: THE DECK
   ===================== */

.deck-form-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 236px; /* below the sticky workbench bar */
    max-height: calc(100vh - 252px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 191, 0, 0.25) transparent;
}

.deck-form-panel::-webkit-scrollbar      { width: 5px; }
.deck-form-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 191, 0, 0.25);
    border-radius: 3px;
}

.deck-preview-card {
    padding: 14px;
    flex-shrink: 0;
}

.deck-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.deck-preview-title {
    font-family: 'DragonSlayer', serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: #ffbf00;
}

.deck-slot-count {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffbf00;
    transition: color 0.2s ease;
}

.deck-slot-count.full {
    color: #81c784;
}

.deck-remove-all {
    height: auto; /* override global button height */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 11px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    letter-spacing: 1.5px;
    color: #f0b8ac;
    background: rgba(244, 67, 54, 0.08);
    border: 1px solid rgba(244, 67, 54, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.deck-remove-all:hover:not(:disabled) {
    color: #ffd0c4;
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(255, 106, 80, 0.7);
    transform: none;
}

.deck-remove-all:disabled {
    opacity: 0.35;
    cursor: default;
}

.modal-icon-danger {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    color: #ff8a70;
    background: radial-gradient(circle at 50% 35%, rgba(244, 67, 54, 0.3), rgba(244, 67, 54, 0.06));
    border: 1px solid rgba(255, 106, 80, 0.45);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.25);
}

/* Power curve: one gold column per power bucket, count on top */
.bld-curve {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 8px 8px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bld-curve[hidden] { display: none; }

.bld-curve-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.bld-curve-value {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    color: #f0ece6;
    font-variant-numeric: tabular-nums;
}

.bld-curve-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 54px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.bld-curve-bar {
    display: block;
    width: 60%;
    max-width: 30px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: #ffbf00;
    transition: height 0.25s ease;
}

.bld-curve-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-align: center;
    color: rgba(240, 236, 230, 0.8);
    overflow-wrap: anywhere;
}

.bld-curve-label small {
    display: block;
    font-size: 0.56rem;
    color: rgba(240, 236, 230, 0.55);
}

.deck-preview-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - 560px);
    min-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 191, 0, 0.25) transparent;
}

.deck-preview-list::-webkit-scrollbar      { width: 5px; }
.deck-preview-list::-webkit-scrollbar-thumb {
    background: rgba(255, 191, 0, 0.25);
    border-radius: 3px;
}

.deck-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.deck-preview-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 191, 0, 0.2);
}

/* A strip of the card's art, cropped to its dragon */
.deck-preview-art {
    flex: 0 0 auto;
    display: block;
    width: 42px;
    height: 28px;
    max-height: none;
    border-radius: 5px;
    object-fit: cover;
    object-position: 50% 30%;
    background: rgba(255, 255, 255, 0.06);
}

.deck-preview-power {
    flex: 0 0 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 191, 0, 0.35);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
    font-weight: bold;
    text-align: center;
    color: #ffd54a;
    font-variant-numeric: tabular-nums;
}

.deck-preview-name {
    flex: 1;
    min-width: 0;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: #f0ece6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-preview-stepper {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-step {
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(240, 236, 230, 0.85);
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.deck-step:hover:not(:disabled) { color: #0e0e0e; background: #ffbf00; transform: none; }
.deck-step:first-child:hover { background: #ef5350; color: #fff; }
.deck-step:first-child { border-radius: 6px 0 0 6px; }
.deck-step:last-child { border-radius: 0 6px 6px 0; }
.deck-step:disabled { opacity: 0.3; cursor: default; }

.deck-preview-count {
    min-width: 26px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.76rem;
    font-weight: bold;
    color: #ffbf00;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.deck-preview-item.maxed .deck-preview-count { color: #81c784; }

.deck-preview-remove {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(240, 236, 230, 0.45);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.deck-preview-remove:hover {
    color: #ff8a80;
    background: rgba(244, 67, 54, 0.15);
    transform: none;
    box-shadow: none;
}

.deck-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.78rem;
    color: rgba(240, 236, 230, 0.6);
    letter-spacing: 0.06em;
    text-align: center;
    padding: 26px 10px;
}

.deck-empty-hint i { font-size: 1.4rem; color: rgba(255, 191, 0, 0.6); }

/* =====================
   DECK FORM (active toggle, card IDs, signed-in line)
   ===================== */

.deck-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    flex-shrink: 0;
}

.form-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    letter-spacing: 2px;
    color: rgba(240, 236, 230, 0.6);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin: 0;
}

.form-hint {
    font-size: 0.64rem;
    color: rgba(240, 236, 230, 0.5);
    letter-spacing: 0.04em;
    text-transform: none;
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.22);
    border-radius: 10px;
    padding: 10px 13px;
    color: #f0ece6;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-input::placeholder {
    color: rgba(240, 236, 230, 0.38);
}

.form-input:focus {
    border-color: rgba(255, 191, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

/* Card IDs: a power-user tool, folded away */
.bld-ids summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    cursor: pointer;
    list-style: none;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(240, 236, 230, 0.75);
}

.bld-ids summary::-webkit-details-marker { display: none; }
.bld-ids summary > i { color: rgba(255, 191, 0, 0.7); transition: transform 0.15s; }
.bld-ids summary:hover { color: #ffd54a; }
.bld-ids[open] summary { margin-bottom: 8px; }
.bld-ids .form-input { font-size: 0.78rem; font-family: monospace; }

/* ── Builder validation feedback ─────────────────── */
.form-input.invalid {
    border-color: rgba(244, 67, 54, 0.85);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.18);
    background: rgba(244, 67, 54, 0.06);
}

.form-input.invalid:focus {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.25);
}

.field-error {
    display: none;
    margin-top: 6px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    color: #ef9a9a;
}

.field-error.show { display: block; }

.deck-preview-card.invalid {
    border-color: rgba(244, 67, 54, 0.6);
    box-shadow: 0 0 0 1px rgba(244, 67, 54, 0.35), 0 0 18px rgba(244, 67, 54, 0.22);
}

.deck-slot-count.invalid {
    color: #ef5350 !important;
    text-shadow: 0 0 8px rgba(244, 67, 54, 0.45);
}

@keyframes deckShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(2px); }
}

.shake { animation: deckShake 0.4s ease; }

/* =====================
   MODE TOGGLE
   ===================== */

.mode-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 191, 0, 0.18);
    border-radius: 10px;
    padding: 3px;
}

.mode-btn {
    flex: 1;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(240, 236, 230, 0.65);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    padding: 8px 0;
    cursor: pointer;
    height: auto;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.mode-btn.active {
    background: #ffbf00;
    color: #0e0e0e;
    font-weight: bold;
}

.mode-btn:hover:not(.active) {
    color: #ffd54a;
    background: rgba(255, 191, 0, 0.1);
    transform: none;
    box-shadow: none;
}

/* Editing a saved deck: its game type is fixed */
.mode-toggle.locked {
    opacity: 0.55;
    pointer-events: none;
}

/* =====================
   SUBMIT BUTTON
   ===================== */

.deck-signed-in-as {
    font-family: 'HwyGothic', sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: rgba(240, 236, 230, 0.5);
    margin: 0;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, #ffd45e, #ffb300);
    color: #0e0e0e;
    border: none;
    border-radius: 10px;
    padding: 11px 0;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.86rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    height: auto;
    box-shadow: 0 4px 14px rgba(255, 170, 0, 0.25);
    transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease;
}

.submit-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 22px rgba(255, 170, 0, 0.45);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* =====================
   RESPONSE MESSAGE
   ===================== */

.response-message {
    padding: 11px 14px;
    border-radius: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.84rem;
    letter-spacing: 0.4px;
    text-align: center;
    display: none;
}

.response-message.success {
    background: rgba(30, 60, 32, 0.95);
    border: 1px solid rgba(129, 199, 132, 0.5);
    color: #a5d6a7;
    display: block;
}

.response-message.error {
    background: rgba(60, 20, 18, 0.95);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ffab9f;
    display: block;
}

/* =====================
   DELETE BUTTON
   ===================== */

.my-deck-delete-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #4a4540;
    font-size: 0.55rem;
    padding: 4px 8px;
    cursor: pointer;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.my-deck-delete-btn:hover {
    color: #e53935;
    border-color: rgba(229, 57, 53, 0.4);
    background: rgba(229, 57, 53, 0.08);
    transform: none;
    box-shadow: none;
}

/* =====================
   DELETE MODAL
   ===================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Deck viewer modal (opened from a deck tile) ── */
.modal-card.deck-view-card {
    position: relative;
    max-width: 760px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 60px);
    box-sizing: border-box;
    padding: 24px 20px 18px;
    gap: 6px;
}

.deck-view-close {
    position: absolute;
    top: 10px;
    right: 12px;
    height: auto;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #7a7068;
    font-size: 1rem;
    cursor: pointer;
}

.deck-view-close:hover { color: #ffbf00; }

.deck-view-meta {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: #8a8078;
}

.deck-view-body {
    width: 100%;
    overflow-y: auto;
}

.deck-view-body .deck-contents-grid { justify-content: center; }
.deck-view-body .deck-contents-card img { width: 92px; height: 129px; }

.modal-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 191, 0, 0.2);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.modal-deck-name {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
}

.modal-warning {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 13px;
    color: #7a7068;
    line-height: 1.5;
    margin: 0;
}

.modal-error {
    color: #e53935;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 13px;
    min-height: 18px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.modal-cancel-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.18s;
    height: auto;
}

.modal-cancel-btn:hover { background: rgba(255, 255, 255, 0.06); }

.modal-delete-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.18s;
    height: auto;
}

.modal-delete-btn:hover { background: #ef5350; }

.modal-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================
   RESPONSIVE: sidebar becomes a wrapping chip bar
   ===================== */

@media only screen and (max-width: 1024px), only screen and (hover: none) {
    .deck-shell {
        flex-direction: column;
        /* The desktop rail uses align-items: flex-start; in a column that would shrink-wrap the
           content column to its widest child (a nowrap table or a long note) and push the Deck
           Doctor off the right edge of a phone. */
        align-items: stretch;
    }

    .deck-content-col { width: 100%; }

    .deck-sidebar {
        position: static;
        flex: none;
        width: auto;
        height: auto;
        max-height: none;
        overflow: visible;
        margin: 10px 10px 0;
        padding: 8px;
        border-radius: 12px;
    }

    .deck-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .deck-new-btn {
        width: auto;
        margin-bottom: 0;
        flex: 0 0 auto;
        padding: 8px 16px;
    }

    /* Flatten the groups into one wrapping chip row */
    .deck-nav-group { display: contents; }
    .deck-nav-group-label { display: none; }

    .deck-tab {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 13px;
        gap: 7px;
        font-size: 0.68rem;
        border: 1px solid rgba(255, 191, 0, 0.14);
        border-radius: 999px;
    }

    .deck-tab.active { border-color: rgba(255, 191, 0, 0.55); }
    .deck-tab > i:first-child { width: auto; }

    .deck-topbar { padding: 12px 12px 0; }

    .deck-heading {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }
}

/* =====================
   MOBILE STYLES
   ===================== */

@media screen and (max-width: 767px), screen and (hover: none) {

    .deck-body {
        padding: 12px 12px 100px; /* extra bottom padding for fixed action-bar */
    }

    /* The header is a drawer here, so the workbench bar pins to the very top. Row 1:
       back + name; row 2: game type, progress, save. */
    .bld-bar {
        top: 6px;
        flex-wrap: wrap;
        gap: 8px 10px;
        padding: 10px;
    }

    .builder-back-btn { padding: 9px 11px; }
    .builder-back-btn > span { display: none; }
    .bld-name { flex: 1 1 calc(100% - 60px); }
    .bld-name .form-label { display: none; }
    .bld-bar .mode-btn { padding: 8px 8px; font-size: 0.6rem; letter-spacing: 0.5px; }
    .bld-progress { flex: 1 1 56px; min-width: 56px; }
    .bld-progress .deck-slot-count { font-size: 0.9rem; }
    .bld-bar .submit-btn { padding: 10px 12px; font-size: 0.72rem; letter-spacing: 0.5px; }

    .deck-builder-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .deck-form-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .deck-preview-list { max-height: none; }

    .card-picker-panel { padding: 10px; }

    .picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
        gap: 9px;
        max-height: 62vh;
        min-height: 240px;
    }

    .picker-search-group { flex-basis: 100%; }
    .picker-chips { flex: 1 1 auto; }
    .picker-chip, .picker-sort select { height: 34px; }

    .form-input {
        font-size: 0.82rem;
    }

    .deck-contents-card img {
        width: 60px;
        height: 84px;
    }

    .deck-contents-grid {
        gap: 5px;
        padding: 10px 10px;
    }

    .deck-contents-badge {
        width: 15px;
        height: 15px;
        font-size: 0.55rem;
        top: 2px;
        right: 2px;
    }
}

/* =====================
   DECK DOCTOR (live builder panel + standalone tab)
   Results first, then the notes, then the evidence. Status colours are
   reserved: green = good, amber = warn, red = bad; gold is the site accent and
   marks "your deck" in every comparison, grey marks the winning-deck average.
   ===================== */

.doctor-wrap {
    margin-top: 24px;
    background: rgba(8, 8, 8, 0.94);
    border: 1px solid rgba(255, 191, 0, 0.12);
    border-radius: 14px;
    padding: 20px 22px;
}

#panel-doctor .doctor-wrap { margin-top: 0; }

.doctor-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 14px;
}

.doctor-title {
    font-family: 'DragonSlayer', serif;
    color: #ffbf00;
    margin: 0;
    letter-spacing: 1.5px;
    font-size: 1.05rem;
}

.doctor-title .stats-lock-icon,
.doctor-title .stats-crown-icon {
    font-size: 0.7rem;
    margin-left: 4px;
}

.doctor-subtitle {
    font-family: 'HwyGothic', Arial, sans-serif;
    color: rgba(240, 236, 230, 0.6);
    font-size: 0.76rem;
    letter-spacing: 0.5px;
}

.doctor-subtitle a { color: rgba(255, 191, 0, 0.8); text-decoration: none; }
.doctor-subtitle a:hover { color: #ffbf00; }

/* The blur/lock surface (reuses stats-locked-overlay / stats-content-locked) */
.doctor-shell {
    position: relative;
    min-height: 160px;
}

.doctor-empty,
.doctor-note {
    font-family: 'HwyGothic', Arial, sans-serif;
    color: rgba(240, 236, 230, 0.5);
    font-size: 0.78rem;
    letter-spacing: 0.4px;
    line-height: 1.45;
    margin: 8px 0 0;
}

.doctor-empty {
    text-align: center;
    padding: 40px 12px;
}

/* ── Shared section chrome ──────────────────────── */
.doctor-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 191, 0, 0.1);
}

.doctor-section-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 12px;
}

.doctor-heading {
    font-family: 'HwyGothic', Arial, sans-serif;
    color: rgba(255, 191, 0, 0.9);
    font-size: 0.76rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

.doctor-section-note {
    font-family: 'HwyGothic', Arial, sans-serif;
    color: rgba(240, 236, 230, 0.48);
    font-size: 0.72rem;
    letter-spacing: 0.3px;
}

.doctor-subheading {
    font-family: 'HwyGothic', Arial, sans-serif;
    color: rgba(240, 236, 230, 0.7);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.doctor-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.doctor-col { min-width: 0; }

.doctor-columns + .doctor-columns { margin-top: 18px; }

/* ── Hero: verdict + stat tiles ─────────────────── */
.doctor-hero-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.doctor-verdict {
    flex-shrink: 0;
    font-family: 'DragonSlayer', serif;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(240, 236, 230, 0.25);
    color: rgba(240, 236, 230, 0.75);
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.doctor-verdict.verdict-winning    { color: #6dd47e; border-color: rgba(109, 212, 126, 0.6); background: rgba(109, 212, 126, 0.1); }
.doctor-verdict.verdict-even       { color: #ffbf00; border-color: rgba(255, 191, 0, 0.55); background: rgba(255, 191, 0, 0.08); }
.doctor-verdict.verdict-struggling { color: #f47670; border-color: rgba(244, 118, 112, 0.55); background: rgba(244, 118, 112, 0.08); }
.doctor-verdict.verdict-early      { color: #ffd54a; border-color: rgba(255, 191, 0, 0.35); }

.doctor-hero-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.doctor-hero-title {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 1.02rem;
    color: #f0ece6;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-hero-sub {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
    color: rgba(240, 236, 230, 0.5);
    letter-spacing: 0.3px;
}

.doctor-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.doctor-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
}

.doctor-tile-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.64rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(240, 236, 230, 0.5);
}

.doctor-tile-value {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 1.75rem;
    line-height: 1.1;
    color: #f0ece6;
}

.doctor-tile-value .good { color: #6dd47e; }
.doctor-tile-value .bad  { color: #f47670; }

.doctor-tile-sub {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    color: rgba(240, 236, 230, 0.55);
    line-height: 1.35;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

/* W/L form dots (last 10) and the full-history strip */
.doctor-form,
.doctor-strip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
}

.doctor-form i,
.doctor-strip i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: rgba(240, 236, 230, 0.15);
}

.doctor-form i.w, .doctor-strip i.w { background: #6dd47e; }
.doctor-form i.l, .doctor-strip i.l { background: rgba(244, 118, 112, 0.75); }

.doctor-strip {
    display: flex;
    gap: 3px;
    margin-bottom: 12px;
}

.doctor-strip i { width: 9px; height: 9px; }

.doctor-delta {
    display: inline-block;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(240, 236, 230, 0.2);
    color: rgba(240, 236, 230, 0.7);
    white-space: nowrap;
}

.doctor-delta.up   { color: #6dd47e; border-color: rgba(109, 212, 126, 0.5); background: rgba(109, 212, 126, 0.1); }
.doctor-delta.down { color: #f47670; border-color: rgba(244, 118, 112, 0.5); background: rgba(244, 118, 112, 0.1); }

/* Pending edit strip (builder, editing a saved deck) */
.doctor-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 191, 0, 0.07);
    border: 1px dashed rgba(255, 191, 0, 0.35);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.76rem;
    color: rgba(240, 236, 230, 0.8);
}

.doctor-pending > i { color: #ffbf00; font-size: 0.7rem; }

.doctor-diff {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

.doctor-diff-chip {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.doctor-diff-chip.added   { color: #6dd47e; background: rgba(109, 212, 126, 0.12); border: 1px solid rgba(109, 212, 126, 0.35); }
.doctor-diff-chip.removed { color: #f47670; background: rgba(244, 118, 112, 0.12); border: 1px solid rgba(244, 118, 112, 0.35); }

/* ── Notes ──────────────────────────────────────── */
.doctor-notes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doctor-note-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(240, 236, 230, 0.25);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #e8e0d4;
}

.doctor-note-item i { margin-top: 2px; font-size: 0.8rem; flex-shrink: 0; }
.doctor-note-item.good { border-left-color: #6dd47e; }
.doctor-note-item.good i { color: #6dd47e; }
.doctor-note-item.warn { border-left-color: #f0b464; }
.doctor-note-item.warn i { color: #f0b464; }
.doctor-note-item.info { border-left-color: rgba(255, 191, 0, 0.6); }
.doctor-note-item.info i { color: rgba(255, 191, 0, 0.8); }

/* ── Results: sparkline, splits, win/loss bars ───── */
.doctor-spark-wrap {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 191, 0, 0.08);
    border-radius: 10px;
    padding: 10px 12px 6px;
    margin-bottom: 14px;
}

.doctor-spark {
    display: block;
    width: 100%;
    height: 70px;
}

.doctor-spark-line {
    fill: none;
    stroke: #ffbf00;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.doctor-spark-mid {
    stroke: rgba(240, 236, 230, 0.22);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.doctor-spark-label {
    display: block;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    color: rgba(240, 236, 230, 0.45);
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.doctor-splits {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.doctor-split {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.08);
    font-family: 'HwyGothic', Arial, sans-serif;
}

.doctor-split-label { font-size: 0.62rem; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(240, 236, 230, 0.5); }
.doctor-split-value { font-size: 1.15rem; color: #f0ece6; }
.doctor-split-sub   { font-size: 0.68rem; color: rgba(240, 236, 230, 0.5); }

.doctor-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.doctor-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
}

.doctor-bar-label {
    color: #e8e0d4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-bar-track {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.doctor-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #ffbf00;
}

.doctor-bar-value {
    color: rgba(240, 236, 230, 0.8);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.doctor-bar-value small { color: rgba(240, 236, 230, 0.45); margin-left: 3px; }

/* ── Version history ────────────────────────────── */
.doctor-versions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doctor-version {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.6fr);
    align-items: center;
    gap: 8px 14px;
    padding: 9px 14px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.08);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.76rem;
    color: rgba(240, 236, 230, 0.7);
}

.doctor-version.current {
    border-color: rgba(255, 191, 0, 0.4);
    background: rgba(255, 191, 0, 0.06);
}

.doctor-version-tag {
    color: #ffbf00;
    letter-spacing: 1px;
    white-space: nowrap;
}

.doctor-version-tag small {
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 191, 0, 0.7);
    margin-left: 4px;
}

.doctor-version-when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doctor-version-record { white-space: nowrap; font-variant-numeric: tabular-nums; }
.doctor-version-record b { color: #f0ece6; font-weight: normal; font-size: 0.9rem; margin-right: 4px; }
.doctor-version-original { color: rgba(240, 236, 230, 0.4); font-style: italic; }

/* ── Card performance table ─────────────────────── */
.doctor-perf-wrap { border-color: rgba(255, 191, 0, 0.12); }

.doctor-perf-table th:first-child,
.doctor-perf-table td:first-child { text-align: left; }

.doctor-perf-card small { color: rgba(255, 191, 0, 0.75); margin-left: 4px; }

.doctor-perf-table tbody tr.thin td { color: rgba(240, 236, 230, 0.38); }
.doctor-perf-table tbody tr.thin .doctor-meter > span { opacity: 0.35; }

/* Ten rows by default; the toggle button adds .expanded */
.doctor-perf-table tbody tr:nth-child(n+11) { display: none; }
.doctor-perf-table.expanded tbody tr { display: table-row; }

.doctor-perf-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.doctor-meter {
    display: inline-block;
    width: 64px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    vertical-align: middle;
}

.doctor-meter > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #ffbf00;
}

.doctor-perf-toggle {
    margin-top: 10px;
    height: auto;
    background: transparent;
    border: 1px solid rgba(255, 191, 0, 0.3);
    border-radius: 6px;
    color: rgba(255, 191, 0, 0.85);
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 6px 14px;
    cursor: pointer;
}

.doctor-perf-toggle:hover { background: rgba(255, 191, 0, 0.12); transform: none; box-shadow: none; }

/* ── Deck profile: facts, power spread, roles ────── */
.doctor-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-bottom: 16px;
}

.doctor-fact {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-family: 'HwyGothic', Arial, sans-serif;
}

.doctor-fact-value { font-size: 1.25rem; color: #f0ece6; line-height: 1.1; }
.doctor-fact-label { font-size: 0.64rem; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(240, 236, 230, 0.5); }
.doctor-fact-label small { text-transform: none; letter-spacing: 0.3px; color: rgba(240, 236, 230, 0.4); }

.doctor-spread {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doctor-spread-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
}

.doctor-spread-label { color: #e8e0d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.doctor-spread-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doctor-spread-bar {
    display: block;
    height: 7px;
    border-radius: 999px;
    min-width: 2px;
}

.doctor-spread-bar.you  { background: #ffbf00; }
.doctor-spread-bar.meta { background: rgba(240, 236, 230, 0.3); }

.doctor-spread-value { color: #f0ece6; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doctor-spread-value b { font-weight: normal; }
.doctor-spread-value small { color: rgba(240, 236, 230, 0.45); }

.doctor-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.66rem;
    color: rgba(240, 236, 230, 0.55);
}

.doctor-legend i {
    display: inline-block;
    width: 14px;
    height: 7px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}

.doctor-legend i.you  { background: #ffbf00; }
.doctor-legend i.meta { background: rgba(240, 236, 230, 0.3); }

.doctor-roles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doctor-role {
    padding: 8px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.08);
}

.doctor-role.empty { border-style: dashed; }

.doctor-role-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.74rem;
}

.doctor-role-name { color: #e8e0d4; }
.doctor-role-count { color: #f0ece6; white-space: nowrap; }
.doctor-role-count b { font-weight: normal; font-size: 0.95rem; }
.doctor-role-count small { color: rgba(240, 236, 230, 0.45); }

.doctor-role-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.doctor-copies-chip,
.doctor-role-none {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.64rem;
    letter-spacing: 0.3px;
    color: rgba(240, 236, 230, 0.75);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.doctor-copies-chip b { color: #ffbf00; font-weight: normal; }
.doctor-role-none { color: rgba(240, 236, 230, 0.35); background: transparent; padding-left: 0; }

/* ── Meta check ─────────────────────────────────── */
.doctor-overlap {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 16px;
    font-family: 'HwyGothic', Arial, sans-serif;
}

.doctor-overlap-value { font-size: 1.6rem; color: #f0ece6; line-height: 1; }
.doctor-overlap-text  { font-size: 0.74rem; color: rgba(240, 236, 230, 0.55); line-height: 1.4; max-width: 60ch; }

.doctor-suggest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.doctor-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 108px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: 10px;
    padding: 8px;
    box-sizing: border-box;
}

.doctor-chip img,
.doctor-chip-noimg {
    width: 72px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.doctor-chip-name {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.7rem;
    color: #e8e0d4;
    text-align: center;
    line-height: 1.2;
}

.doctor-chip-name b { color: #ffbf00; font-weight: normal; }

.doctor-chip-meta {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.3px;
    color: rgba(240, 236, 230, 0.5);
    text-align: center;
    line-height: 1.25;
}

.doctor-add-btn {
    width: 100%;
    margin-top: 2px;
    background: rgba(255, 191, 0, 0.16);
    border: 1px solid rgba(255, 191, 0, 0.4);
    border-radius: 6px;
    color: #ffbf00;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.62rem;
    letter-spacing: 1px;
    padding: 5px 0;
    cursor: pointer;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.16s ease;
}

.doctor-add-btn:hover { background: rgba(255, 191, 0, 0.3); transform: none; box-shadow: none; }
.doctor-add-btn i { font-size: 0.55rem; }

/* ── Standalone tab: saved-deck picker ──────────── */
.doctor-deck-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.doctor-picker-group { display: flex; flex-direction: column; gap: 6px; }

.doctor-picker-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(240, 236, 230, 0.4);
}

.doctor-picker-row { display: flex; flex-wrap: wrap; gap: 8px; }

.doctor-deck-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 191, 0, 0.14);
    border-radius: 9px;
    padding: 8px 14px;
    cursor: pointer;
    height: auto;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.doctor-deck-btn:hover { background: rgba(255, 191, 0, 0.08); border-color: rgba(255, 191, 0, 0.4); transform: none; box-shadow: none; }
.doctor-deck-btn.active { background: rgba(255, 191, 0, 0.14); border-color: rgba(255, 191, 0, 0.55); }

.doctor-deck-btn-name {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.8rem;
    color: #e8e0d4;
    letter-spacing: 0.4px;
}

.doctor-deck-btn.active .doctor-deck-btn-name { color: #ffbf00; }

.doctor-deck-btn-active {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.56rem;
    letter-spacing: 1.2px;
    color: #6dd47e;
    border: 1px solid rgba(109, 212, 126, 0.45);
    border-radius: 999px;
    padding: 1px 6px;
}

@media only screen and (max-width: 767px), only screen and (hover: none) {
    .doctor-wrap { padding: 16px 14px; }
    .doctor-columns { grid-template-columns: 1fr; }
    .doctor-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doctor-tile-value { font-size: 1.45rem; }
    .doctor-splits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doctor-hero-head { align-items: flex-start; flex-direction: column; gap: 8px; }
    .doctor-version { grid-template-columns: auto minmax(0, 1fr); }
    .doctor-version-record,
    .doctor-version .doctor-diff,
    .doctor-version-original { grid-column: 1 / -1; }
    .doctor-chip { width: calc(50% - 5px); }
}
