/* === Global layout & typography (from original base.html) === */

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
    color: #e5f0ff;
    font-family: 'Uncial Antiqua', 'Cinzel Decorative', serif;
}

header {
    background: linear-gradient(180deg, #020617 0%, #02040b 40%, #020617 100%);
    padding: 24px 40px 32px;
    border-bottom: 3px solid #1d4ed8;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

header h1 {
    margin: 0;
    padding: 0;
    font-size: 44px;
    text-shadow:
        0 0 10px rgba(59, 130, 246, 0.9),
        0 0 20px rgba(37, 99, 235, 0.7);
    letter-spacing: 3px;
    color: #bfdbfe;
}

.subtitle {
    margin-top: 12px;
    font-size: 18px;
    opacity: 0.9;
    color: #9ca3af;
    letter-spacing: 1px;
}

main {
    padding: 32px 28px 40px;
    max-width: 1200px;
    margin: 30px auto 0;
    background: linear-gradient(
        145deg,
        rgba(15, 23, 42, 0.96),
        rgba(8, 14, 26, 0.98)
    );
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(15, 23, 42, 0.9);
}

footer {
    text-align: center;
    padding: 18px;
    margin-top: 40px;
    font-size: 13px;
    opacity: 0.7;
    color: #6b7280;
}

p {
    margin-top: 0;
}

/* === Landing page layout & components (from original index.html) === */

.landing-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 32px;
    align-items: center;
}

@media (max-width: 900px) {
    .landing-layout {
        grid-template-columns: 1fr;
    }

    .search-row {
        grid-template-columns: 1fr;
        }
}

.landing-blurb-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 26px;
    margin-bottom: 10px;
    color: #e5e7eb;
    letter-spacing: 2px;
}

.landing-blurb-text {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #d1d5db;
    max-width: 36rem;
}

.landing-highlight {
    color: #fbbf24;     /* your yellow highlight */
    font-weight: 600;
    text-shadow: none;
}

.feature-list {
    margin-top: 14px;
    padding-left: 18px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    font-size: 13px;
    color: #9ca3af;
}

.feature-list li {
    margin-bottom: 6px;
}

.cta-panel {
    border-left: 2px solid rgba(59, 130, 246, 0.6);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cta-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 20px;
    color: #bfdbfe;
}

.cta-text {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 26px;
    border-radius: 999px;
    border: 1px solid #1d4ed8;
    background: radial-gradient(circle at top, #1d4ed8, #0f172a);
    color: #e5f0ff;
    font-family: 'Cinzel Decorative', serif;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.7);
    transition:
        transform 0.1s ease-out,
        box-shadow 0.1s ease-out,
        background 0.1s ease-out;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.9);
    background: radial-gradient(circle at top, #2563eb, #020617);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 0 8px rgba(30, 64, 175, 0.8);
}

/* === Deck Builder Layout & Typography === */

.builder-layout {
    margin-top: 8px;
}

.builder-main {
    /* Easier-to-read font like on the homepage text */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
}

.builder-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 24px;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.builder-intro {
    font-size: 14px;
    line-height: 1.7;
    color: #d1d5db;
    max-width: 42rem;
    margin-bottom: 20px;
}

.builder-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.9));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.builder-hero-text {
    flex: 2;
}

.builder-status-block {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.builder-status-title {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bfdbfe;
    margin-bottom: 6px;
}

.builder-status-block .deck-status {
    align-items: flex-end;
}

.section-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 16px;
    margin: 18px 0 6px;
    color: #bfdbfe;
    }

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

.field-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 4px;
}

/* === Search Inputs === */

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.search-input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.95);
    padding: 8px 14px;
    font-size: 14px;
    color: #e5e7eb;
    outline: none;
}

.search-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.75);
}

.small-search {
    width: 100%;
    max-width: 420px;
}

.large-search {
    width: 100%;
    max-width: 420px;
}

/* === Avatar Section === */

.avatar-section {
    margin-bottom: 18px;
}

.avatar-display {
    margin-top: 8px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.avatar-label {
    font-weight: 500;
    color: #9ca3af;
    margin-right: 4px;
}

.avatar-name {
    font-weight: 600;
    color: #fbbf24;
}

.avatar-clear-btn {
    display: none;
    padding: 0;
    margin-left: 6px;
}

/* === Dropdowns (Avatar search) === */

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(3, 7, 18, 0.96); /* opaque dark background */
    border-radius: 12px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.75);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 20;
}

.search-dropdown--reserved {
    display: block;
    visibility: hidden;
    min-height: 140px;
    padding: 6px;
}

.search-dropdown--reserved.open {
    visibility: visible;
}

.search-dropdown-inner {
    max-height: 220px;
    overflow-y: auto;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
}

.search-dropdown-item:hover {
    background: rgba(15, 23, 42, 0.9);
}

.dropdown-item-name {
    flex: 1;
    margin-right: 8px;
}

.dropdown-item-button {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.9);
    background: radial-gradient(circle at top, #1d4ed8, #020617);
    color: #e5f0ff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

/* === Threshold icons + shared card name styling === */
.card-name-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-name-text {
    font-weight: 600;
}

.threshold-icon-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.threshold-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.35));
}

.threshold-icon--stat {
    width: 16px;
    height: 16px;
    filter: none;
}

.mana-cost-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #dedcdc;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow:
        0 0.12em 0.2em rgba(34, 34, 34, 0.85),
        0.1em 0.08em 0.2em rgba(34, 34, 34, 0.85);
}

.threshold-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === Card tooltip === */
#card-tooltip {
    position: absolute;
    display: none;
    background: #05070d;
    border: 1px solid rgba(55, 65, 81, 0.8);
    border-radius: 10px;
    padding: 10px 12px;
    width: 240px;
    min-height: 160px;
    color: #e5e7eb;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 80;
}

.card-tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-tooltip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-tooltip-top-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-tooltip-name {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: 'Cinzel Decorative', serif;
}

.card-tooltip-stats {
    text-align: right;
    color: #cbd5e1;
    font-size: 12px;
    min-width: 90px;
}

.card-tooltip-rules {
    font-size: 12px;
    line-height: 1.4;
    color: #d1d5db;
    text-align: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.card-meta {
    color: #9ca3af;
    font-size: 12px;
}

/* === Card search results === */

.card-search-results {
    margin-top: 10px;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(55, 65, 81, 0.85);
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.96),
        rgba(15, 23, 42, 0.9)
    );
    font-size: 13px;
}

.card-search-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.add-card-button {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.9);
    background: radial-gradient(circle at top, #1d4ed8, #020617);
    color: #e5f0ff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

/* === Deck lists side by side === */

.deck-section {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.deck-stats {
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.deck-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.deck-stat-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
}

.deck-stat-title {
    margin: 0 0 8px;
    font-size: 13px;
    color: #bfdbfe;
    letter-spacing: 0.05em;
}

.deck-stat-list {
    margin: 0;
    padding-left: 16px;
    color: #e5e7eb;
    font-size: 12px;
    line-height: 1.5;
}

.deck-stat-list li {
    margin-bottom: 3px;
}

.elem-air { color: #60a5fa; }
.elem-earth { color: #84cc16; }
.elem-fire { color: #f97316; }
.elem-water { color: #38bdf8; }

#mana-curve-chart {
    width: 100%;
    max-width: 700px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 8px;
    box-sizing: border-box;
}

.deck-status {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    }

.deck-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #fbbf24;
    background: rgba(15, 23, 42, 0.9);
    color: #fbbf24;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    width: fit-content;
}

.deck-status-pill--legal {
    border-color: rgba(34, 197, 94, 0.8);
    color: #bbf7d0;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.deck-status-pill--illegal {
    border-color: #fbbf24;
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.deck-status-errors {
    margin: 0;
    padding-left: 18px;
    color: #fbbf24;
    font-size: 12px;
    line-height: 1.5;
    text-align: right;
}

.deck-column {
    flex: 1 1 0;
    min-width: 220px;
}

.deck-avatar-block {
    margin-bottom: 10px;
}

.deck-list {
    list-style: none;
    margin: 8px 0 0;
    padding-left: 0;
    font-size: 13px;
    color: #e5e7eb;
}

.deck-list li {
    padding: 3px 0;
    border-bottom: 1px dashed rgba(55, 65, 81, 0.8);
}

.deck-subtitle {
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding: 6px 0 4px;
    margin-top: 6px;
    font-weight: 700;
    color: #bfdbfe;
}

.deck-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.deck-item-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.deck-item-controls {
    display: inline-flex;
    gap: 6px;
}

.deck-item-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.deck-item-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.35);
}

.deck-item-btn:active {
    transform: translateY(0);
}

.deck-item-btn--plus {
    border-color: rgba(59, 130, 246, 0.8);
    color: #c7d2fe;
}

.deck-item-btn--minus {
    border-color: rgba(59, 130, 246, 0.8);
    color: #c7d2fe;
}

.deck-item-btn--clear {
    border-color: rgba(251, 191, 36, 0.9);
    color: #fbbf24;
}
