body {
    background: #111;
    color: white;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
#iconContainer {
    --hex-width: 128px;
    --hex-height: 128px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: calc(var(--hex-width) * 12);
    max-width: 100vw;
    box-sizing: border-box;
    padding: 10px;
}
.hex {
    width: var(--hex-width);
    height: var(--hex-height);
    position: relative;
    overflow: hidden;
    clip-path: polygon(
        50% 0%,
        100% 25%,
        100% 75%,
        50% 100%,
        0% 75%,
        0% 25%
    );
    cursor: pointer;
    opacity: .25;
}
.hex.active{
    opacity: 1;
}
.hex img {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    position: absolute;
    inset: 4px;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    clip-path: inherit;
}
.hex-row {
    display: flex;
    gap: 12px;
    margin-bottom: -20px;
}
.hex-row.offset {
    margin-left: 70px;
}
.hex.state-0, .nav-hex.state-0 {
    background: #404040;
}
.hex.state-1, .nav-hex.state-1 {
    background: #53d5c2;
}
.hex.state-2, .nav-hex.state-2 {
    background: #a806d3;
}
.hex.state-3, .nav-hex.state-3 {
    background: linear-gradient(
        to bottom,
        #ffdf60,
        #a806d3
    );
}
.hex.state-4, .nav-hex.state-4 {
    background: linear-gradient(
        to bottom,
        #de1111,
        #ffdf60
    );
}
.summary-hex {
    opacity: 1;
}
.summary-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    background: white;
    color: black;
}
#ownedPercent {
    font-size: 16px;
}
#stateBtnImg{
    width: 96px;
    height: 96px;
}
#navBar {
    position: fixed;
    top: 0;
    right: 0;
    gap: 12px;
    z-index: 9999;
    width: 192px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}
.nav-row {
    width: 100%;
    height: 64px;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}
.nav-row.offset .nav-hex {
    transform: translateX(-48px) !important;
}
.nav-hex {
    width:96px;
    height:96px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
    user-select:none;
    background:#666;
    clip-path: polygon(
        50% 0%,
        100% 25%,
        100% 75%,
        50% 100%,
        0% 75%,
        0% 25%
    );
    pointer-events: auto;
}
#navBar.collapsed #toggleSidebar {
    transform: translateX(48px);
    clip-path: polygon(
        50% 0%,
        50% 100%,
        0% 75%,
        0% 25%
    );
}
#navBar.collapsed .nav-hex:not(#toggleSidebar) {
    display: none;
}
#transBtn.active {
    background: #9CD5FA;
}
#fsiBtn.active {
    background: linear-gradient(
        to bottom,
        #ffdf60,
        #a806d3
    );
}
.translevel {
    position: absolute;
    bottom: 30px;
    right: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #9CD5FA;
    color: #333;
    font-weight: bold;
}
.level {
    position: absolute;
    top: 30px;
    right: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    color: black;
    font-weight: bold;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal.hidden {
    display: none;
}
.modal-content {
    background: #222;
    color: white;
    width: min(500px, 90vw);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    justify-content: center;
}
.modal-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-body {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
}
.help-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.helper-hex {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    cursor: default;
    pointer-events: none;
}
.helper-hex .level {
    top: 20px;
    right: 5px;
}
.helper-hex .tlevel {
    position: absolute;
    bottom: 15px;
    right: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #9CD5FA;
    color: #333;
    font-weight: bold;
}