/* --- RESET & BASICS --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Cinzel', serif;
}

/* --- VIEWPORT --- */
#viewport {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 583px; /* Fixed Height */
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
#bg-layer img, #fg-layer img { width: 100%; height: 100%; object-fit: cover; }
#fg-layer img { object-fit: cover; }

/* --- TREE LAYER --- */
#tree-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: grab;
    opacity: 1;
    transition: opacity 0.8s ease;
}

#world {
    position: absolute;
    width: 0; height: 0; 
    transform-origin: 0 0;
}

#lines-canvas {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
}

/* --- GOD NODES --- */
.god-node {
    position: absolute;
    width: auto; height: 200px;
    transform: translate(-50%, -50%) scale(0.5);
    text-align: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: transform 0.3s, opacity 0.5s;
}

.god-node img {
    width: 200px; height: 200px;
    border-radius: 0%;
    border: 0px solid #d4af37;
    background: #ffffff00;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
}

.god-node span {
    display: block;
    margin-top: -40px;
    color: #d4af37;
    font-size: 56px;
    font-weight: 1000;
    text-shadow: 3px 3px 3px #000;
    background: rgba(0, 0, 0, 0.0);
    padding: 4px 8px;
    border-radius: 8px;
}
.god-node:hover { transform: translate(-50%, -50%) scale(0.6); z-index: 10; }

/* --- GOD VIEW LAYER --- */
#god-view-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 150; /* Ensure it is above the tree nodes */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

#god-view-layer.active {
    opacity: 1;
    pointer-events: auto;
}

/* Background image for the profile view */
.gv-background {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; /* Behind content */
}

.gv-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1); /* Darken slightly so text is easier to read */
}

#gv-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    padding: 20px;
    color: rgb(255, 255, 255);
}

#gv-name {
    /* Min: 1.1rem (mobile), Preferred: 4vw, Max: 1.8rem (desktop) */
    font-size: clamp(1.6rem, 3.6vw, 2.4rem);
    font-family: 'Cinzel', serif;
    color: #d4af37;
    margin-bottom: 0px;
    text-shadow: 1px 1px 1px rgb(0, 0, 0);
}

#gv-main-img {
    width: auto;
    height: clamp(300px, 40vw, 350px);
    border-radius: 0%;
    border: 0px solid #d4af37;
    object-fit: cover;
    margin-bottom: 0px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
}

#gv-blurb {
    /* Min: 1.1rem (mobile), Preferred: 4vw, Max: 1.8rem (desktop) */
    font-size: clamp(0.7rem, 1.5vw, 1.4rem);
    line-height: 1.4;
    margin-bottom: 00px;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent box for readability */
    padding: 10px;
    border-radius: 12px;
    text-shadow: 1px 1px 2px #000;
}

/* Styling for the button inside the profile */
#gv-content .greek-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #d4af37;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s;
}

#gv-content .greek-btn:hover {
    background: #d4af37;
    color: #000;
}

/* --- UI ELEMENTS --- */
#main-title-container {
    position: absolute;
    top: 25px; left: 20px;
    text-align: left;
    color: #d4af37;
    opacity: 0; 
    transition: opacity 2s;
    pointer-events: none;
    z-index: 50; 
}
#main-title-container h1 { font-size: clamp(1.3rem, 2.6vw, 3.0rem); text-shadow: 1px 1px 1px #000; margin-bottom: -8px; font-weight: bolder; }
#main-title-container p { font-size: 12px; text-shadow: 0.5px 0.5px 0.5px #000000; margin-bottom: 0px; font-style: italic; font-weight:bolder; }
#main-title-container h2 { font-size: 12px; text-shadow: 1px 1px 1px #000; color: #d4af37cc; }
#main-title-container h3 { font-size: 12px; text-shadow: 0.5px 0.5px 1px #000; color: #6e2fbacc; } 

#legend {
    position: absolute;
    bottom: 40px; left: 20px;
    text-align: left;
    color: #d4af37;
    opacity: 0; 
    transition: opacity 2s;
    pointer-events: none;
    z-index: 50;
    padding: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); background: rgb(255, 255, 255); 

}
#legend h1 { font-size: 26px; text-shadow: 1px 1px 1px #000; margin-bottom: -10px; font-weight: bolder; }
#legend p { font-size: 10px; text-shadow: 0.5px 0.5px 0.5px #000000; margin-bottom: 8px; font-style: italic; font-weight:bolder; }
#legend h2 { font-size: 12px; text-shadow: 0.5px 0.5px 0.5px #000; color: #d4af37cc; }
#legend h3 { font-size: 12px; text-shadow: 0.0px 0.0px 0.0px #000; color: #6e2fbacc; }  


.greek-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #d4af37;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    padding: 8px 14px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
    transition: all 0.3s;
    z-index: 50;
}
.greek-btn:hover { background: #d4af37; color: #000; }

#btn-full-tree {
    position: absolute;
    top: 20px; left: 20px;
    z-index: 60;
}

#viewport, #tree-layer {
    /* Prevents the browser from handling pans and zooms so your JS can do it */
    touch-action: none; 
    /* Prevents the "magnifying glass" and text selection while dragging */
    -webkit-user-select: none;
    user-select: none;
}