html {
    height: 100%;
}

body.profile-layout {
    background: radial-gradient(circle at top, #f7efe3, #f2e0c6 45%, #d7b68c);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2f1b0c;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.profile-layout:before,
body.profile-layout:after {
    content: none !important;
    display: none !important;
}

.profile-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3.5rem;
    flex: 1 0 auto;
}

.profile-nameplate {
    margin-bottom: 1.75rem;
    text-align: center;
}

.profile-nameplate__title {
    font-size: 2.25rem;
    letter-spacing: 0.03em;
    margin: 0;
    color: #3a1d0d;
}

.profile-section + .profile-section {
    margin-top: 2.5rem;
}

.profile-section__header {
    margin-bottom: 1.5rem;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(58, 31, 13, 0.15);
}

.profile-section__header h2 {
    font-size: 1.45rem;
    margin: 0;
    color: #fff5d6;
    padding: 1rem 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    background: linear-gradient(270deg, rgba(255, 200, 80, 0.39) 0%, rgba(255, 151, 28, 0.57) 55%, rgba(140, 32, 0, 0.7) 100%);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.profile-stats-grid--compact {
    margin-top: 0.75rem;
}

.profile-stat {
    background: rgba(255, 255, 255, 0.86);
    border-radius: 0;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 4px 10px rgba(71, 43, 22, 0.14);
    text-align: center;
}

.profile-stat__label {
    font-size: 0.95rem;
    color: #7d5633;
    margin-bottom: 0.35rem;
}

.profile-stat__value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #3d2311;
}

.profile-stat__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-stat__row img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.profile-world__map {
    background: rgba(255, 255, 255, 0.86);
    border-radius: 0;
    padding: 1.35rem 1.35rem 1.75rem;
    box-shadow: 0 8px 20px rgba(71, 43, 22, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

body.profile-layout #world.profile-world__canvas {
    display: block;
    margin: 0 auto;
    max-width: 441px;
    min-width: 441px;
    width: 441px;
    background: #49b2f7;
    background-image: url('../img/bg/tiles/Tiles/water.png');
    padding: 60px 0 0;
    color: #2980b9;
    position: relative;
    border: 1px solid #ececec;
    border-radius: 0;
    min-height: 230px;
}

.profile-world__empty {
    margin: 0;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0;
    color: #6d4626;
}

.profile-world__canvas > .world-component {
    width: 100%;
    margin: 0 auto;
}

.profile-world__map #region_select {
    margin-left: auto;
    margin-right: auto;
}

.world-component .tool-content {
    display: none;
}

.world-component .profile-open .tool-content {
    display: block;
}

.world-component .hexagon.profile-open {
    outline: 3px solid rgba(125, 88, 54, 0.65);
}

#people_pop {
    display: none;
    background: rgba(255, 249, 236, 0.94);
    border: 2px solid rgba(88, 48, 17, 0.8);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 12px 28px rgba(43, 23, 9, 0.26);
    border-radius: 0;
    width: 100%;
    max-width: 520px;
    color: #3b2412;
}

#people_pop.popshow {
    display: block;
}

#people_pop .row {
    margin-left: 0;
    margin-right: 0;
}

#people_pop .col,
#people_pop .col-6,
#people_pop .col-10,
#people_pop .col-4,
#people_pop .col-5,
#people_pop .col-7,
#people_pop .col-8,
#people_pop .col-12 {
    padding-left: 0;
    padding-right: 0;
}

#people_pop .landscapeimg,
#people_pop .landscapeimg_sm {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

#people_pop #prosp_close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    margin-bottom: 0.5rem;
}

#people_pop h4.ribbon-level {
    margin: 0.5rem auto 0.75rem;
}

.profile-tooltip {
    position: absolute;
    background: rgba(50, 32, 18, 0.9);
    color: #fcefdc;
    padding: 0.5rem 0.75rem;
    border-radius: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    max-width: 260px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.profile-tooltip:after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -6px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(50, 32, 18, 0.9) transparent transparent transparent;
}

@media (max-width: 640px) {
    .profile-container {
        padding: 1.75rem 1rem 3rem;
    }

    .profile-hero {
        padding: 1.25rem;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
    }

    .profile-section__header h2 {
        font-size: 1.3rem;
    }
}
