body {
  margin: 0;
  overflow: hidden;
  background: rgba(0,0,0,0.6);
  font-family: 'Ubuntu', sans-serif;
  user-select: none;
  -webkit-user-select: none; 
  -moz-user-select: none;    
  -ms-user-select: none;   
  -webkit-touch-callout: none;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

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

#chat_textbox {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 300px;
  height: 32px;
  border-radius: 6px;
  border: none;
  padding-left: 12px;
  background: #2b2d31;
  color: #fff;
  z-index: 20; 
  transition: width 0.3s ease;
}

#chat_textbox:focus {
  outline: none;
  background: rgba(0,0,0,0.6);
}

@media (max-width: 599px) {
  #chat_textbox {
    width: calc(100% - 20px);
    left: 10px;
    right: 10px;
    bottom: 15px;
    height: 40px;
    font-size: 16px;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  #chat_textbox {
    width: 250px;
  }
}

#mobileStuff {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

#splitBtn, #ejectBtn {
    width: 60px;
    height: 60px;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

#splitBtn {
    background: #4CAF50;
}

#ejectBtn {
    background: #f44336;
}

#splitBtn:active, #ejectBtn:active {
    transform: scale(0.95);
}

#touchCircle {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid white;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
}

#overlays {
  position: fixed;
  inset: 0;                
  display: flex;            
  align-items: center;     
  justify-content: center;  
  z-index: 100; 
  pointer-events: none;     
}

#overlays > * {
  pointer-events: auto;     
}

.helloDialog {
  width: 900px;
  max-width: 96%;
}

@media (max-width: 599px) {
  .helloDialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px; 
}

.server-select {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: #1e1f23;
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 599px) {
  .server-select {
    padding: 15px;
    font-size: 16px;
  }
}

.server-select option {
  background: #1e1f23;
  color: #fff;
}

.color-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.color-row div {
  flex: 1;
}

@media (max-width: 599px) {
  .color-row {
    flex-direction: column;
    gap: 5px;
  }
}

.settings-panel {
  font-size: 11px;  
  padding: 8px;    
  overflow: visible;
}

@media (max-width: 599px) {
  .settings-panel {
    flex: 1;
    font-size: 14px;
    padding: 12px;
  }
}

.panel-title {
  text-align: center;
  font-size: 13px; 
  margin-bottom: 6px;
  font-weight: 600;
}

@media (max-width: 599px) {
  .panel-title {
    font-size: 18px;
    margin-bottom: 15px;
  }
}

.settings-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px; 
  margin-bottom: 8px;
}

.settings-list label {
  display: flex;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
}

@media (max-width: 599px) {
  .settings-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .settings-list label {
    font-size: 15px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
  }
  
  .settings-list input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }
}

.settings-list input {
  margin-right: 4px;
  padding: 1px 3px; 
  font-size: 11px;
}

.settings-colors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px; 
  margin-top: 6px;
}

@media (max-width: 599px) {
  .settings-colors {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.settings-colors div {
  display: flex;
  flex-direction: column;
}

.settings-colors label {
  font-size: 11px;
  margin-bottom: 2px;
}

@media (max-width: 599px) {
  .settings-colors label {
    font-size: 14px;
    margin-bottom: 5px;
  }
}

.settings-colors .form-control {
  width: 100%;
  padding: 2px 4px; 
  font-size: 11px;
  border-radius: 3px;
  border: none;
  background: #1e1f23;
  color: #fff;
}

@media (max-width: 599px) {
  .settings-colors .form-control {
    padding: 10px;
    font-size: 15px;
  }
}

.form-group {
  text-align: center;
  margin-bottom: 18px;
}

.logo {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
}

@media (max-width: 599px) {
  .logo {
    font-size: 48px;
    margin-top: 20px;
  }
}

.players {
  font-size: 13px;
  opacity: 0.7;
}

@media (max-width: 599px) {
  .players {
    font-size: 16px;
    margin-bottom: 10px;
  }
}

.background-blur {
  position: absolute; 
  inset: 0;
  background: rgba(0, 0, 0, 0.35);  
  backdrop-filter: blur(0.5px);     
  -webkit-backdrop-filter: blur(0.5px);
  z-index: 0;  
}

#logo-text {
  position: relative; 
  z-index: 1;        
  font-size: 36px;
  font-weight: 800;
  color: #fff;
}

@media (max-width: 599px) {
  #logo-text {
    font-size: 42px;
  }
}

.panels {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 20px;
  position: relative;
  z-index: 1;
}

@media (max-width: 599px) {
  .panels {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    height: 100%;
    overflow-y: auto;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .panels {
    grid-template-columns: 200px 1fr 200px;
    gap: 10px;
  }
}

.panel {
  background: #2b2d31;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  color: #fff;
}

@media (max-width: 599px) {
  .panel {
    padding: 20px;
    border-radius: 20px;
  }
}

.left-panel { text-align: center; }
.center-panel { text-align: center; }

.ui-input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}

@media (max-width: 599px) {
  .ui-input {
    padding: 15px;
    font-size: 16px;
    margin-bottom: 15px;
  }
}

.button-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 599px) {
  .button-row {
    flex-direction: column;
    gap: 8px;
  }
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn:hover { transform: scale(1.02); }

@media (max-width: 599px) {
  .btn {
    padding: 15px;
    font-size: 16px;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
}

.btn.primary { background: #2d5cff; color: #fff; }
.btn.secondary { background: #666; color: #fff; }

.links {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

@media (max-width: 599px) {
  .links {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    font-size: 14px;
  }
}

.links a {
  color: #bbb;
  text-decoration: none;
}

@media (max-width: 599px) {
  .links a {
    padding: 8px 15px;
    display: inline-block;
  }
}

.panel-header {
  text-align: center;     
  font-size: 20px;        
  font-weight: 600;            
  margin: 0 0 10px 0;  
}

@media (max-width: 599px) {
  .panel-header {
    font-size: 24px;
    margin-bottom: 20px;
  }
}

.server-item {
  background: #3a3d42;
  padding: 10px;
  border-radius: 6px;
}

.server-item.active {
  background: #444;
}

@media (max-width: 599px) {
  .server-item {
    padding: 15px;
    font-size: 16px;
  }
}

@media (max-width: 899px) and (orientation: landscape) {
  .panels {
    max-height: 100vh;
    overflow-y: auto;
  }
  
  .helloDialog {
    max-height: 100vh;
    overflow-y: auto;
  }
}

@media (min-width: 900px) and (max-width: 1200px) {
  .panels {
    grid-template-columns: 220px 1fr 220px;
  }
  
  .panel-header {
    font-size: 18px;
  }
}
