*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh;
}

body {
    margin: 0;
    padding: 0;
    background-image: url('/static/bgf.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #c4a071;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
}

.character-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/character_background.png');
    background-size: cover;
    opacity: 0.3;
    z-index: -1;
}

.action-points {
    display: flex;
    align-items: center;
}

.action-points img {
    width: 30px;
    height: 30px;
    margin-right: 5px;
}


.expedition-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graph-container {
    position: absolute; 
    top:100px; 
    bottom:0px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.expedition-panel svg {
    width: 100%;
    height: 100%;
}


.left-panel.expedition-mode {
    height: 105px;
    padding: 5px;
}

.left-panel.expedition-mode > :not(.character-panel) {
    display: none;
}

.message-with-icon {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.message-with-icon img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.game-container {
    display: flex;
    width: 100%;
    height: 100%;
    
    background-image: url('/static/bgfmap_trans.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.left-panel {
    width: 550px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99; /* Убедитесь, что это значение выше, чем у других элементов */
}

.auth-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: min(920px, calc(100% - 24px));
    max-width: 920px;
    text-align: left;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.auth-card,
.changelog-panel {
    background-color: rgba(255, 255, 255, 0.88);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
}

.auth-card {
    text-align: center;
}

.app-version {
    margin: -0.4rem 0 1rem;
    font-size: 0.85rem;
    color: #444;
}

.app-version-num {
    font-family: Consolas, "Courier New", monospace;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #1a1a1a;
}

.changelog-panel {
    max-height: min(70vh, 520px);
    overflow: auto;
}

.changelog-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.changelog-meta {
    margin: 0 0 0.9rem;
    font-size: 0.85rem;
    color: #444;
    line-height: 1.35;
}

.changelog-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #222;
}

.changelog-list li {
    margin-bottom: 0.45rem;
}

.changelog-empty,
.changelog-hint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: #666;
}

.changelog-hint {
    font-family: Consolas, "Courier New", monospace;
}

.character-panel {
    border: 1px solid #ccc;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 100; /* Убедитесь, что это значение выше, чем у других элементов */
    flex-shrink: 0;
}

.character-name {
    margin-top: 5px;
    margin-bottom: 10px;
}

.character-info {
    display: flex;
    align-items: center;
    
    height: 105px;
}

.character-image img {
    width: 100px;
    height: 100px;
    margin-right: 10px;
    margin-bottom: -5px;
    margin-left: 2px;
}

.character-panel .button-row {
    display: flex;
}

.character-panel button {
    margin-right: 10px;
}

.location-description, .actions-panel {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    overflow-y: auto;
    min-height: 0;
}

.location-description {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.45;
}

.location-description h2 {
    margin-top: 0;
    font-size: 1.25em;
    line-height: 1.3;
}

.location-description p,
.location-description .additional-text {
    font-size: 1em;
    line-height: 1.45;
}

.location-debug-id {
    display: block;
    margin: 0 0 0.75em 0;
    padding: 0.35em 0.6em;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    background: #ffd54a;
    border: 1px solid #c9a227;
    border-radius: 2px;
}

.location-debug-id[hidden] {
    display: none !important;
}

.actions-panel {
    max-height: 300px;
}

.actions-panel button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: left;
}

.right-panel {
    width: 350px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    height: 100%;
    height: 100dvh;
    overflow: auto;
    position: fixed;
    right: 0;
    top: 0;
    display: none;
}

/* Mobile: fit viewport without page scroll; readable location/dialogue text */
@media (max-width: 768px) {
    .left-panel {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .left-panel.expedition-mode {
        height: auto;
        min-height: 105px;
        max-height: 30vh;
    }

    .location-description {
        font-size: 17px;
        line-height: 1.5;
        padding: 12px;
    }

    .location-description h2 {
        font-size: 1.2em;
        margin-bottom: 0.5em;
    }

    .actions-panel {
        max-height: min(38vh, 280px);
        flex-shrink: 0;
    }

    .actions-panel button {
        font-size: 16px;
        padding: 12px;
        margin-bottom: 8px;
    }

    .character-info {
        height: auto;
        min-height: 90px;
    }

    .character-image img {
        width: 80px;
        height: 80px;
    }

    .auth-container {
        width: calc(100% - 24px);
        max-width: 920px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .changelog-panel {
        max-height: 40vh;
    }
}

.panel {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border: 1px solid #ccc;
    margin-top: 10px;
}

.equipment-slots {
    display: flex;
    margin-bottom: 10px;
}

.equipment-slots div {
    width: 50px;
    height: 50px;
    border: 1px solid #000;
    margin-right: 10px;
}

.resource_container {
  display: flex; /* Используем flexbox */
  align-items: center; /* Выравниваем по вертикали */
  justify-content: left; /* Выравниваем по горизонтали */
  text-align: center; /* Дополнительно для текста, если не flex */
}

.metallic-button {
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.metallic-button:hover {
    background: linear-gradient(145deg, #5a5a5a, #3a3a3a);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.messages {
    color: red;
    list-style-type: none;
    padding: 0;
}

.messages li {
    margin-bottom: 10px;
}

#resourcesList img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

#equipmentSlots div {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 5px;
    display: inline-block;
}
