@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

:root {
    --accent: #d4af37;
    --bg: #f2ead8;
    --panel: rgba(25, 22, 18, 0.84);
    --border: rgba(255, 255, 255, 0.16);
    --text-muted: #b7b0a5;
    --header-height: 80px;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.10), transparent 36%),
        linear-gradient(135deg, #f3ead8 0%, #ded0b2 50%, #f5ecd9 100%);
    font-family: 'Inter', sans-serif;
    color: #fff;
}

body {
    overflow: hidden;
}

#renderCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    outline: none;
    display: block;
    z-index: 1;
    touch-action: none;
}

.ui-wrapper {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    padding: 22px;
    z-index: 10;
    gap: 18px;
}

.glass-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.028)),
        var(--panel);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 24px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.10);
    overflow: hidden;
}

.sidebar-catalog {
    width: 315px;
    height: calc(100vh - var(--header-height) - 44px);
}

.catalog-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at top left, rgba(212,175,55,0.24), transparent 42%),
        rgba(0,0,0,0.18);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 9px;
    color: rgba(255,255,255,0.68);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(212,175,55,0.9);
}

.catalog-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.22rem;
    margin: 0;
    color: #f7d66c;
    letter-spacing: 0.8px;
}

#total-count {
    font-size: 10px;
    color: var(--text-muted);
    margin: 8px 0 0;
    letter-spacing: 1px;
}

.filter-toggle {
    width: calc(100% - 28px);
    margin: 14px 14px 0;
    border: 1px solid rgba(212,175,55,.35);
    background: rgba(212,175,55,.14);
    color: #f7d66c;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filter-toggle::after {
    content: "+";
    font-size: 18px;
    line-height: 1;
}

.filter-toggle.active::after {
    content: "−";
}

.filter-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-section {
    padding: 14px;
    background: rgba(0,0,0,.22);
    border-bottom: 1px solid var(--border);
}

.filter-section.collapsed {
    display: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.filter-clear-btn {
    width: 100%;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.86);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.filter-clear-btn:hover {
    background: rgba(212,175,55,.13);
    color: #f7d66c;
}

.filter-loading {
    opacity: .58;
    pointer-events: none;
}

.custom-select,
.custom-input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    padding: 10px 11px;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.custom-input {
    box-sizing: border-box;
}

.custom-input::placeholder {
    color: rgba(255,255,255,0.48);
}

.custom-select option {
    color: #111;
}

.coin-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
}

.coin-list::-webkit-scrollbar,
.detail-card::-webkit-scrollbar {
    width: 4px;
}

.coin-list::-webkit-scrollbar-thumb,
.detail-card::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.65);
    border-radius: 10px;
}

.coin-item {
    position: relative;
    padding: 12px 13px 12px 14px;
    margin-bottom: 9px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.22s ease;
    border: 1px solid transparent;
    background: linear-gradient(90deg, rgba(255,255,255,0.062), rgba(255,255,255,0.026));
    overflow: hidden;
}

.coin-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
}

.coin-item:hover {
    background: linear-gradient(90deg, rgba(212,175,55,0.13), rgba(255,255,255,0.05));
    transform: translateX(3px);
}

.coin-item.active {
    background: linear-gradient(90deg, rgba(212,175,55,0.24), rgba(212,175,55,0.06));
    border-color: rgba(212,175,55,0.38);
}

.coin-item.active::before {
    background: var(--accent);
    box-shadow: 0 0 14px rgba(212,175,55,0.9);
}

.coin-item h4 {
    margin: 0;
    font-size: 12.8px;
    font-weight: 700;
    color: #f3f3f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coin-item p {
    margin: 5px 0 0;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-card {
    width: 395px;
    max-height: calc(100vh - var(--header-height) - 44px);
    overflow-y: auto;
    opacity: 0;
    transform: translateX(28px);
    transition: 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-card.active {
    opacity: 1;
    transform: translateX(0);
}

.detail-inner {
    padding: 26px;
}

.detail-topline {
    font-size: 9px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 10px;
}

.detail-card h2 {
    font-family: 'Playfair Display', serif;
    margin: 0 0 20px;
    font-size: 1.85rem;
    line-height: 1.08;
    color: #fff;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 23px;
}

.meta-grid > div {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.045);
}

.meta-label {
    font-size: 9px;
    color: #f7d66c;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    display: block;
}

.meta-value {
    font-size: 13px;
    color: #ebe7dc;
    line-height: 1.42;
}

.description-box {
    font-size: 13px;
    line-height: 1.78;
    color: #ddd8cb;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.detail-hint {
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(212,175,55,0.30);
    background: rgba(212,175,55,0.12);
    border-radius: 16px;
    color: #f7d66c;
    font-size: 11px;
    letter-spacing: 0.6px;
    line-height: 1.5;
}

.center-hud {
    position: fixed;
    left: 50%;
    top: calc(var(--header-height) + 22px);
    transform: translateX(-50%);
    z-index: 9;
    pointer-events: none;
    width: min(520px, 42vw);
    text-align: center;
}

.showroom-badge {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(134, 96, 30, 0.25);
    background: rgba(255,255,255,0.36);
    backdrop-filter: blur(20px);
    color: #5d4219;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.coin-status {
    margin-top: 10px;
    color: rgba(60,44,22,0.82);
    font-size: 12px;
    line-height: 1.45;
    text-shadow: 0 1px 8px rgba(255,255,255,0.65);
}

.vr-action {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    z-index: 20;
    display: flex;
    gap: 10px;
}

.btn-vr,
.btn-mini {
    border: none;
    border-radius: 100px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-vr {
    background: #2a2116;
    color: #f7d66c;
    padding: 13px 34px;
    font-size: 11px;
}

.btn-mini {
    background: rgba(255,255,255,0.68);
    color: #4d3715;
    border: 1px solid rgba(134, 96, 30, 0.28);
    padding: 12px 18px;
    font-size: 10px;
    backdrop-filter: blur(16px);
}

.btn-vr:hover,
.btn-mini:hover {
    transform: translateY(-2px);
    background: var(--accent);
    color: #111;
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212,175,55,0.14), transparent 34%), var(--bg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-arc {
    width: 52px;
    height: 52px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
    .detail-card {
        width: 340px;
    }

    .sidebar-catalog {
        width: 285px;
    }

    .center-hud {
        display: none;
    }
}

@media (max-width: 900px) {
    html,
    body {
        position: relative !important;
        width: 100%;
        height: auto !important;
        min-height: 100%;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body {
        padding: 0;
    }

    #renderCanvas {
        position: relative;
        display: block;
        width: 100%;
        height: 56vh;
        min-height: 390px;
        max-height: 540px;
        z-index: 1;
    }

    .center-hud {
        display: none;
    }

    .ui-wrapper {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: 5;
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 12px 12px 102px;
        pointer-events: auto;
        background: linear-gradient(180deg, rgba(242,234,216,0.10), rgba(242,234,216,0.96) 18%);
    }

    .sidebar-catalog {
        width: 100%;
        height: auto;
        min-height: auto;
        max-height: none;
        order: 1;
        border-radius: 18px;
    }

    .catalog-header {
        padding: 16px;
    }

    .catalog-header h1 {
        font-size: 1.05rem;
    }

    #total-count {
        font-size: 9px;
    }

    .filter-section {
        padding: 12px;
    }

    .custom-select {
        font-size: 12px;
        padding: 11px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .coin-list {
        flex: none;
        max-height: 300px;
        overflow-y: auto;
        padding: 10px;
    }

    .coin-item {
        padding: 11px 12px;
        margin-bottom: 8px;
    }

    .coin-item h4 {
        font-size: 12px;
    }

    .coin-item p {
        font-size: 9px;
    }

    .detail-card {
        display: flex;
        width: 100%;
        max-height: none;
        height: auto;
        opacity: 1;
        transform: none;
        order: 2;
        border-radius: 18px;
    }

    .detail-inner {
        padding: 18px;
    }

    .detail-card h2 {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    .meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .description-box {
        font-size: 12.5px;
        line-height: 1.65;
    }

    .detail-hint {
        font-size: 10.5px;
    }

    .vr-action {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        transform: none;
        width: auto;
        z-index: 30;
        display: flex;
        gap: 8px;
    }

    .btn-vr,
    .btn-mini {
        flex: 1;
        padding: 12px 8px;
        font-size: 8.5px;
        letter-spacing: 0.8px;
    }
}