@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;

    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- Main Container and Background --- */
.character-screen-container {
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 700px;

    position: relative;
    overflow: hidden;
    
    gap: 0;
    border-radius: 8px;
}

.character-screen-container:not(.hidden) {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 1fr auto;
}

.background-overlay {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* --- Left Sidebar Navigation (Desktop) --- */
.sidebar-nav {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    padding: 20px 0 20px 20px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    font-size: 1.1em;
    padding: 8px 15px;
    margin-bottom: 5px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.3s, background-color 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: #ffd700;
}

.nav-item.active {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #ffcc66;
}

/* --- Main Details Panel --- */
.main-content-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 20px 40px;
    z-index: 2;
    max-width: 450px;
    display: flex;
    flex-direction: column;
}

#character-name {
    font-family: 'Roboto', sans-serif;
    font-size: 3em;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 204, 102, 0.5);
}

.vc-details {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #ccc;
}

.description {
    line-height: 1.6;
    font-weight: 300;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid #ffcc66;
}

/* --- Visual Panel (Image and Quote) --- */
.visual-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    z-index: 2;
}

#character-quote {
    position: absolute;
    bottom: 25%;
    right: 450px;
    font-size: 1.8em;
    font-style: italic;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    max-width: 300px;
}

#main-character-img {
    position: fixed;
    right: -2;
    top: -1;
    height: 80%;
    object-fit: contain;
    transform: translateX(50px);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease-in-out; 
}


/* --- Character Selection Bar (Bottom) --- */
.character-selection-bar {
    position: absolute;
    bottom: 0; 
    right: 0; 
    left: 200px;
    width: calc(100% - 200px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    z-index: 5;
    border-top: 0px solid rgba(255, 255, 255, 0.1); 
    border-bottom-right-radius: 8px;
    overflow-x: auto;
}

.char-icon-wrapper {
    flex-shrink: 0;
    text-align: center;
    margin: 0 10px;
    padding: 5px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s, background-color 0.3s;
    border-radius: 5px;
}

.char-icon-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.char-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #555;
}

.char-icon-wrapper.active .char-icon {
    border-color: #ffcc66;
}

.char-name {
    font-size: 0.8em;
    margin-top: 5px;
    color: #fff;
}

/* --- Start Screen Styles (NEW) --- */
#start-screen {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000; 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease-in-out; 
}

.hidden {
    display: none !important;
}

.fading-out {
    opacity: 0 !important;
}

.start-box-overlay {
    width: 90vw;
    height: 90vh;
    max-width: 700px; 
    max-height: 450px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.start-box-overlay h1 {
    font-family: 'Times New Roman', serif; /* Simulating the font style from the image */
    font-size: 5em;
    font-weight: normal;
    color: #fff;
    margin-bottom: 30px;
    line-height: 1.1;
    text-shadow: 0 0 15px rgba(255, 204, 102, 0.5);
}

#start-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#start-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #ffcc66;
    color: #ffcc66;
}

/* FIX: Utility class to hide elements completely */
.hidden {
    display: none !important;
}


/* MOBILE OPTIMIZATION         */

@media (max-width: 768px) {

    .start-box-overlay {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .start-box-overlay h1 {
        font-size: 3em;
        margin-bottom: 50px;
    }
    
    #start-button {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .character-screen-container {
        width: 100vw;
        height: 100vh;
        max-width: unset;
        max-height: unset;
        /* FIX: Grid properties applied conditionally */
    }
    
    .character-screen-container:not(.hidden) {
        grid-template-columns: 1fr; 
        grid-template-rows: auto 1fr auto;
    }
    
    .background-overlay {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
    }

    /* --- Sidebar (Now Top Nav) --- */
    .sidebar-nav {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        padding: 10px;
        background: rgba(0, 0, 0, 0.8);
        overflow-x: auto;
        white-space: nowrap;
    }

    .sidebar-nav ul {
        display: flex;
        padding-left: 0;
    }

    .nav-item {
        font-size: 0.9em;
        padding: 5px 10px;
        margin-bottom: 0;
        margin-right: 5px; 
        border-left: none;
        border-bottom: 3px solid transparent;
        display: inline-block;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid #ffcc66;
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* --- Main Details Panel (Center) --- */
    .main-content-panel {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        padding: 15px;
        max-width: unset;
        background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
        z-index: 3;
        max-height: 50vh;
        overflow: hidden;
    }

    #character-name {
        font-size: 2em;
        margin-bottom: 5px;
    }
    
    .vc-details {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .description {
        font-size: 0.9em;
        padding: 10px;
        flex-grow: 1;
        max-height: 100px;
        overflow-y: auto;
    }

    /* --- Visual Panel (Background Image) --- */
    .visual-panel {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        z-index: 2;
        pointer-events: none;
        padding-bottom: 110px;
        padding-top: 50px;
        overflow: hidden;
    }

    #main-character-img {
        position: absolute;
        bottom: 0;
        transform: translateX(-50%);
        top: unset;
        right: unset;
        transform: none;
        height: 600px;
        width: 600px;
        object-fit: contain;
        opacity: 1;
        z-index: 2;
    }

    #character-quote {
        position: relative;
        bottom: unset;
        right: unset;
        font-size: 1.2em;
        margin-top: 10px;
        margin-bottom: 0px;
        padding: 0 15px;
        max-width: 90%;
        text-shadow: 0 0 5px rgba(0, 0, 0, 1);
        z-index: 4;
        bottom: unset;
        right: unset;
        pointer-events: all;
    }
    
    /* --- Character Selection Bar (Bottom) --- */
    .character-selection-bar {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        left: 0;
        width: 100%;
        padding: 10px 0;
        border-bottom-right-radius: 0;
        overflow-x: auto;
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    .character-selection-bar > div {
        width: max-content;
        margin: 0 auto;
    }
    
    .character-selection-bar {
        justify-content: flex-start;
    }

    .character-selection-bar::after {
        content: '';
        flex-grow: 1;
        min-width: 20px;
    }

    .character-selection-bar {
        display: block;
        white-space: nowrap;
        text-align: center;
        overflow-x: auto;
    }

    .char-icon-wrapper {
        display: inline-block;
        flex-shrink: 0; 
        text-align: center;
        margin: 0 5px;
        padding: 5px;
        cursor: pointer;
        border: 3px solid transparent;
        transition: border-color 0.3s, background-color 0.3s;
        border-radius: 5px;
    }
    
    .char-icon {
        width: 50px;
        height: 50px;
    }

}


