body {
    font-family: sans-serif;
    background-color: #282c34;
    color: #abb2bf;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
    overflow: hidden;
}

h1 {
    color: #61afef;
}

#game-status {
    display: flex;
    gap: 20px;
    background-color: #21252b;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #3b4048;
}

#game-status span {
    font-weight: bold;
    color: #98c379;
}

/* --- COLLAPSIBLE CONTROLS --- */
.controls-wrapper {
    background-color: #21252b;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #3b4048;
    width: 380px;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.controls-header {
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.toggle-icon {
    transition: transform 0.3s ease-out;
}

.controls-wrapper.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.controls {
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    align-items: center;
    max-height: 500px; /* Set a max-height for transition */
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

.controls-wrapper.collapsed .controls {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}
/* --- END COLLAPSIBLE CONTROLS --- */

label {
    font-weight: bold;
    white-space: nowrap;
}

input[type="number"] {
    width: 80px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #3b4048;
    background-color: #1c1f24;
    color: #abb2bf;
}

button {
    grid-column: 1 / -1;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 5px;
}

#generateBtn { background-color: #98c379; }
#generateBtn:hover { background-color: #89b06a; }
#godViewBtn { background-color: #61afef; }
#godViewBtn:hover { background-color: #5295c9; }

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Đưa canvas ra sau */
    background-color: #000;
}

/* KHÔI PHỤC STYLE CHO JOYSTICK */
#joystick-container {
    position: fixed;
    bottom: 50px;
    left: 50px;
    z-index: 10;
    display: block;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#joystick-knob {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    top: 30px;
    left: 30px;
    cursor: grab;
    user-select: none;
}
