:root {
    --bg: #101522;
    --panel: #181f31;
    --panel-2: #121829;
    --panel-3: #1b2336;
    --line: #434f6c;
    --line-soft: #2b354e;
    --text: #ffffff;
    --muted: #afbbd2;
    --muted-2: #cfddef;
    --yellow: #ffda4c;
    --blue: #408ee8;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

body { min-height: 100vh; }

.main-header {
    min-height: 88px;
    padding: 9px 28px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 48%),
        linear-gradient(100deg, rgb(52,39,85) 0%, rgb(18,29,53) 100%);
    border-top: 1px solid rgba(180,207,255,.35);
    border-bottom: 2px solid #070c18;
    box-shadow: 0 5px 18px rgba(0,0,0,.30);
}

.brand-title {
    font-size: 32px;
    line-height: 42px;
    font-weight: 900;
    letter-spacing: .4px;
    color: #ffe44d;
    text-shadow:
        2px 0 #408ee8,
        -2px 0 #408ee8,
        0 2px #408ee8,
        0 -2px #408ee8,
        3px 4px 0 rgba(3,11,28,.75);
}

.brand-subtitle {
    margin-left: 5px;
    margin-top: 1px;
    font-size: 14px;
    font-weight: 600;
    color: #cfddf7;
}

.brand-subtitle span {
    margin: 0 5px;
    color: #8797b7;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
    padding: 7px 11px;
    border: 1px solid rgba(132,153,195,.35);
    border-radius: 7px;
    background: rgba(9,15,29,.28);
    color: #dce6f8;
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5ede97;
    box-shadow: 0 0 8px rgba(94,222,151,.55);
}

.main-tabs {
    height: 49px;
    padding-left: 18px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    background: #111727;
    border-bottom: 1px solid #2f3952;
}

.tab {
    height: 41px;
    min-width: 145px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.tab:hover {
    background: #192238;
    color: white;
}

.tab.active {
    color: white;
    background: var(--bg);
    border-color: #394560;
    box-shadow: inset 0 3px 0 #5a8fe6;
}

.page-shell {
    padding: 14px;
    min-height: calc(100vh - 137px);
}

.glass-panel {
    border: 1px solid #303b56;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0)), #181f31;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 4px 14px rgba(0,0,0,.20);
}

label {
    display: block;
    margin-bottom: 5px;
    color: #afbbd2;
    font-size: 12px;
    font-weight: 650;
}

input[type="text"], select {
    min-height: 36px;
    width: 100%;
    padding: 6px 10px;
    color: white;
    background: #121829;
    border: 1px solid #46536f;
    border-radius: 3px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus, select:focus {
    border-color: #6699ea;
    box-shadow: 0 0 0 2px rgba(71,127,219,.17);
}

.hunter-button {
    min-height: 34px;
    padding: 7px 16px;
    white-space: nowrap;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-weight: 650;
    border-radius: 5px;
    border: 1px solid #51617e;
    background: linear-gradient(180deg, #354361 0%, #232e47 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}

.hunter-button:hover {
    border-color: #6f86ad;
    background: linear-gradient(180deg, #405273 0%, #2a3854 100%);
}

.hunter-button:active { transform: translateY(1px); }

.explore-layout {
    display: grid;
    grid-template-columns: minmax(680px, 1fr) 380px;
    gap: 8px;
    min-height: calc(100vh - 165px);
}

.explore-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-panel {
    padding: 16px;
    margin-bottom: 10px;
}

.search-grid {
    display: grid;
    grid-template-columns: 52% 48%;
}

.field-group { min-width: 0; }
.card-field { padding-left: 10px; }

.field-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 90px 150px;
    gap: 8px;
}

.separator {
    height: 1px;
    margin: 15px 0 11px;
    background: #434f6c;
}

.filter-row {
    display: grid;
    grid-template-columns: 340px 280px 1fr;
    align-items: end;
    gap: 12px;
}

.missing-check {
    min-height: 36px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #ffda4c;
    font-size: 14px;
    font-weight: 700;
}

.missing-check input {
    width: 17px;
    height: 17px;
    accent-color: #5d8fe0;
}

.cards-toolbar {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toolbar-title {
    color: #afbbd2;
    font-size: 13px;
    font-weight: 650;
}

.table-panel {
    flex: 1;
    min-height: 300px;
    overflow: auto;
    border: 1px solid #303b56;
    background: #141b2c;
}

.cards-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.cards-table th {
    height: 38px;
    padding: 8px 10px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
    color: #e1e7f4;
    background: #202a40;
    border-right: 1px solid #37435e;
    border-bottom: 1px solid #4a5670;
}

.cards-table td {
    height: 38px;
    padding: 7px 10px;
    color: #dce4f3;
    border-right: 1px solid #273149;
    border-bottom: 1px solid #273149;
}

.cards-table tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
.cards-table tbody tr:hover { background: #202a42; }

.owned-col {
    width: 48px;
    text-align: center !important;
}

.number-col { width: 110px; }

.empty-row td {
    height: 180px;
    text-align: center;
    color: #8390aa;
}

.detail-panel {
    min-width: 0;
    padding: 18px;
}

.detail-placeholder {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #8e9bb5;
}

.detail-placeholder h2 {
    margin: 20px 0 7px;
    color: #e3e9f5;
    font-size: 18px;
}

.detail-placeholder p {
    max-width: 280px;
    margin: 0;
    line-height: 1.5;
    font-size: 13px;
}

.card-placeholder {
    width: 174px;
    aspect-ratio: 63 / 88;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #56627d;
    background: linear-gradient(145deg, #293653, #171e31);
    box-shadow: 0 15px 30px rgba(0,0,0,.35);
}

.card-placeholder-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #52617d;
    border-radius: 5px;
    color: #6d7c9a;
    font-size: 12px;
    font-weight: 800;
}

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

.binder-toolbar {
    min-height: 60px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
    background: #181f31;
    border: 1px solid #2e3952;
}

.binder-title {
    font-size: 22px;
    font-weight: 650;
    color: white;
}

.binder-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.era-select { width: 205px; }

.binder-list {
    flex: 1;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #101522;
}

.binder-empty {
    text-align: center;
    color: #8996af;
}

.binder-empty h2 {
    margin: 17px 0 7px;
    color: #e0e6f2;
}

.binder-empty p {
    margin: 0;
    max-width: 440px;
    line-height: 1.55;
}

.binder-icon {
    width: 150px;
    height: 112px;
    margin: auto;
    position: relative;
    border: 2px solid #4a5772;
    border-radius: 6px 13px 13px 6px;
    background: linear-gradient(135deg, #2d3b5b, #1a2338);
    box-shadow: 0 16px 30px rgba(0,0,0,.28);
}

.binder-icon::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #52617e;
}

.binder-ring {
    position: absolute;
    left: 8px;
    width: 18px;
    height: 10px;
    border: 2px solid #8795b1;
    border-radius: 50%;
    background: #182034;
}

.binder-ring:nth-child(1) { top: 20px; }
.binder-ring:nth-child(2) { top: 50px; }
.binder-ring:nth-child(3) { top: 80px; }

@media (max-width: 1050px) {
    .explore-layout { grid-template-columns: 1fr; }
    .detail-panel { min-height: 340px; }
    .filter-row { grid-template-columns: 1fr 260px; }
}

@media (max-width: 760px) {
    .main-header { padding: 10px 16px; }
    .brand-title { font-size: 26px; }
    .brand-subtitle { font-size: 12px; }
    .header-status { display: none; }
    .main-tabs { padding-left: 8px; }
    .tab {
        min-width: 0;
        flex: 1;
        padding: 0 8px;
        font-size: 13px;
    }
    .page-shell { padding: 8px; }
    .search-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card-field { padding-left: 0; }
    .field-row { grid-template-columns: 1fr; }
    .filter-row { grid-template-columns: 1fr; }
    .binder-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .binder-tools {
        align-items: stretch;
        flex-direction: column;
    }
    .era-select { width: 100%; }
}
