html, body {
    padding: 0;
    margin: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#overlays {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
}

#connecting {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    z-index: 100;
    background-color: rgba(0,0,0,0.5);
}

#connecting-content {
    width: 350px;
    background-color: #fff;
    margin: 100px auto;
    border-radius: 15px;
    padding: 5px 15px;
}

#canvas {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%;
    height: 100%;
}

#helloDialog {
    width: 380px;
    background-color: #fff;
    margin: 10px auto;
    border-radius: 15px;
    padding: 5px 15px 5px 15px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-height: 520px;
}

#footer {
    position: absolute;
    bottom: 15px;
    left: 0; right: 0;
    text-align: center;
}

#chat_textbox {
    transition: all .5s ease-in-out;
    position: absolute;
    z-index: 1;
    bottom: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 0px;
    outline: none;
    color: #fff;
    height: 30px;
    text-indent: 12px;
    left: 10px;
    width: 300px;
}

#chat_textbox:focus {
    background: rgba(0,0,0,.5);
}

#play-btn {
    flex: 1;
    float: none;
}

.btn-friend {
    width: 40px;
    flex-shrink: 0;
    float: none;
}

.btn-settings {
    width: 40px;
    flex-shrink: 0;
    float: none;
}

.btn-row {
    display: flex;
    gap: 2px;
    align-items: center;
    margin-bottom: 6px;
}

.mode-btn {
    padding: 5px 14px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}
.mode-btn:hover { border-color: #337ab7; }
.mode-btn.active { background: white; border-color: #337ab7; }

.server-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#spectate-btn {
    flex-shrink: 0;
    width: 30%;
    margin-top: 0;
}

#xpSection {
    position: absolute;
    bottom: 35px;
    left: 15px;
    right: 15px;
}

#settings label {
    margin-right: 10px;
}

.checkbox label {
    margin-right: 10px;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

.center {
    display: table;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}