@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;400;800;900&display=swap');

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

html, body {
    overflow: hidden;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 100%;
}

#mainContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    min-width: 800px;
}

#messageArea {
    width: 388px;
    min-width: 388px;
    max-width: 388px;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    gap: 20px;
}

.lang-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    /*flex-direction: column;*/
    margin-top: 4px;
    margin-right: 4px;
    z-index: 4;
}

.lang-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    border: 1px solid #D9D9D9;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #000000;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lang-btn:hover {
    opacity: 1;
}

.lang-btn.active {
    color: #FF0000;
}

.stats-section {
    display: flex;
    flex-direction: column;
    margin-bottom: auto;
    min-height: 150px;
    padding-bottom: 20px;
}

.result-section {
    margin-bottom: 10px;
    position: relative;
    flex-shrink: 0;
}

.result-text {
    font-family: 'Inter', sans-serif;
    font-weight: 100;
    font-style: italic;
    font-size: 40px;
    color: black;
    line-height: 42px;
}

.description-container {
    height: 150px;
    position: relative;
    margin-top: 12px;
    overflow: auto;
    flex-shrink: 0;
    margin-right: 20px;
}

.instinct-line {
    margin: 10px 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.instinct-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
    background: transparent;
}

.instinct-word {
    font-weight: 900;
    font-style: italic;
    opacity: 0;
    transition: opacity 1s ease;
}

#animal-instinct-placeholder,
#ru-animal-instinct-placeholder {
    opacity: 1;
    background: transparent;
}

.result-text div {
    background: transparent;
}

.description-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #000;
    line-height: 19px;
    margin-top: 0;
    opacity: 0;
    transition: opacity 1s ease;
    max-width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.animal-name {
    font-weight: 100;
    font-style: italic;
    opacity: 0;
    transition: opacity 1s ease;
}

.button-section {
    margin-bottom: 20px;
    margin-top: 40px;
    position: relative;
    padding-top: 32px;
    flex-shrink: 0;
    margin-right: 15px;
}

.button-prompt {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #000;
    margin-bottom: 12px;
    text-align: left;
    display: none;
    line-height: 18px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.trace-button {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    width: 100%;
    height: 40px;
    padding: 8.66px 0px 9.34px 0px;
    border-radius: 3px;
    border: 1px solid #000;
    background: #FFF;
    color: #000;
    cursor: pointer;
    text-align: center;
    text-indent: 0;
    transition: background-color 1s ease, color 1s ease, border-color 1s ease;
}

.trace-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.trace-button.red-button:hover {
    background-color: #cc0000;
}

.header {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 20px;
    color: black;
    margin-bottom: 20px;
    line-height: 1.2;
}

.stats-container {
    display: grid;
    grid-template-columns: minmax(80px, 80px) 1fr;
    column-gap: 0px;
    margin-bottom: 8px;
    align-items: baseline;
}

.stats-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #8E9193;
    white-space: nowrap;
    text-align: left;
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-value {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: black;
    text-align: left;
    padding-left: 0;
    margin-left: 0;
}

#canvasContainer {
    position: relative;
    width: calc(100% - 388px);
    height: 100%;
    overflow: hidden;
    border-left: 1px solid black;
    flex-grow: 1;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#outlineCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.en-structure, .ru-structure {
    transition: opacity 0.3s ease;
}

/* Mobile responsiveness */
@media (max-width: 800px) {
    #mainContainer {
        flex-direction: column;
        min-width: 100%;
    }
    
    #messageArea {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    #canvasContainer {
        width: 100%;
        height: calc(100vh - 300px);
        border-left: none;
        border-top: 1px solid black;
    }
    
    .lang-switcher {
        top: 10px;
        right: 10px;
    }
}