:root {
    --gold: #d4af37;
    --dark-bg: #050505;
    --panel-bg: rgba(20, 20, 20, 0.9);
    --glass-border: rgba(212, 175, 55, 0.2);
    --text-gold: #f1e4bc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: white;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: radial-gradient(circle at center, #111 0%, #000 100%);
}

header {
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.controls-info {
    font-size: 0.7rem;
    color: var(--text-gold);
    opacity: 0.5;
    letter-spacing: 1px;
    display: flex;
    gap: 1.5rem;
}

main {
    flex: 1;
    display: flex;
    position: relative;
    padding: 0;
}

#tool-shelf {
    width: 100px;
    background: rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 2rem;
    z-index: 60;
}

.tool-item {
    width: 60px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    opacity: 0.5;
}

.tool-item:hover {
    opacity: 0.8;
    background: var(--glass);
}

.tool-item.active {
    opacity: 1;
    background: var(--glass);
    border: 1px solid var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.tool-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-gold);
}

#workspace {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#process-steps {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 70;
    pointer-events: none;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.3;
    transition: all 0.5s;
}

.step-item.active {
    opacity: 1;
}

.step-num {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    border: 1px solid var(--gold);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.step-txt {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-gold);
}

.step-arrow {
    color: var(--gold);
    opacity: 0.3;
}

.tool-item.special {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.tool-item.special:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
    opacity: 1;
}

.divider {
    width: 40px;
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

#three-container {
    width: 100%;
    height: 100%;
}

#inventory-toggle {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#inventory-toggle:hover {
    background: var(--gold);
    color: black;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

@keyframes impact {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#info-panel {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 4px;
    backdrop-filter: blur(20px);
    z-index: 50;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#info-panel.hidden {
    opacity: 0;
    transform: translateY(-50%) translateX(50px);
    pointer-events: none;
}

.panel-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.rarity {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-gold);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.divider {
    height: 1px;
    background: linear-gradient(to right, var(--gold), transparent);
    margin-bottom: 1.5rem;
}

.meaning {
    font-style: italic;
    color: #ccc;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.fact {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 2rem;
}

#next-gem-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s;
}

#next-gem-btn:hover {
    background: var(--gold);
    color: black;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@media (max-width: 1000px) {
    #info-panel {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        top: auto;
        transform: none;
        width: calc(100% - 4rem);
    }

    #info-panel.hidden {
        transform: translateY(100px);
    }
}

/* Gallery & Preview UI */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.gallery-container {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: rgba(20, 20, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    font-size: 2rem;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#close-gallery {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#close-gallery:hover {
    opacity: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    overflow-y: auto;
    padding-right: 10px;
}

.gem-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gem-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-10px);
}

.gem-card .gem-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.gem-card h3 {
    font-size: 1.1rem;
    margin: 5px 0;
}

.gem-card p {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Preview Screen */
.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
}

#preview-three-container {
    flex: 1;
    cursor: grab;
}

.preview-info {
    width: 400px;
    background: rgba(0, 0, 0, 0.4);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-info h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.preview-info .meaning {
    font-size: 1.3rem;
    color: #aaa;
    margin-bottom: 20px;
    font-style: italic;
}

.preview-info .fact {
    line-height: 1.8;
    margin-bottom: 40px;
}

#close-preview {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 15px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

#close-preview:hover {
    background: #fff;
    color: #000;
}