body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100%;
}

canvas {
    display: block;
    touch-action: none;
}

canvas:focus {
    outline: none;
}

#toolbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 10px;
    box-sizing: border-box;
    z-index: 10;
    font-family: sans-serif;
    overflow-y: auto; /* Enables scroll */
    scrollbar-width: thin;
}

.tile-group h4 {
    cursor: pointer;
    margin: 10px 0 5px;
    font-size: 14px;
    font-weight: bold;
}

.tile-list {
    display: none;
    margin-left: 5px;
}

.tile-group.open .tile-list {
    display: block;
}

.tile-group:has(.tile-button:not([hidden])) {
  display: block;
}

.tile-group:not(:has(.tile-button:not([hidden]))) {
  display: none;
}

.tile-button {
    display: block;
    margin: 2px 0;
    width: 100%;
}

.tile-button[hidden] {
  display: none;
}

#help-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(50, 50, 50, 0.85);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    font-family: sans-serif;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    user-select: none;
}

#help-button:hover {
    background-color: rgba(70, 70, 70, 0.95);
}

#controls {
    position: absolute;
    bottom: 70px;
    right: 20px;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    background-color: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 10px;
    box-sizing: border-box;
    z-index: 15;
    font-family: sans-serif;
    font-size: 14px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

#controls a {
    color: #8ab4f8;
    text-decoration: none;
}

#controls a:hover {
    text-decoration: underline;
}

#attribution {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 12px;
    color: white;
    background-color: rgba(30, 30, 30, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 15;
    font-family: sans-serif;
}

#attribution a {
    color: #8ab4f8;
    text-decoration: none;
}

#attribution a:hover {
    text-decoration: underline;
}

#alpha-disclaimer {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 200, 0, 0.95);
    color: black;
    font-weight: bold;
    font-family: sans-serif;
    padding: 8px 36px 8px 12px;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    z-index: 25;
    font-size: 14px;
}

#alpha-disclaimer span#alpha-close {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

#alpha-disclaimer span#alpha-close:hover {
    color: #333;
}