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-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #5865F2 0%, #7289da 45%, #5865F2 100%);
    background-size: 200% 200%;
    color: #fff;
    font-family: 'Ubuntu', 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.45);
    animation: discordPulse 2.2s ease-in-out infinite, discordShine 3.5s linear infinite;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-discord:hover,
.btn-discord:focus {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 22px rgba(88, 101, 242, 0.6);
}

.btn-discord:active {
    transform: translateY(0) scale(0.98);
}

.btn-discord svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: currentColor;
}

@keyframes discordPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(88, 101, 242, 0.45); }
    50% { box-shadow: 0 4px 22px rgba(114, 137, 218, 0.75), 0 0 18px rgba(88, 101, 242, 0.35); }
}

@keyframes discordShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.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); }
}