body {
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
   
    text-align: center;
    background-color: #f0f0f0;
    padding: 20px;
  font-size: calc(14px + 0.3vw); /* Responsive font size */
    overflow-x: hidden;
}

h1 {
    color: #333;
  margin-bottom: 10px;
}

.experiment-container {
  background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 30px;
    max-width: 1000px;
    margin: 30px auto;
    border: 1px solid #eaeaea;
   margin-top: 5px; 
  
    display: flex;
    justify-content: space-around;
    
   
   flex-direction: row; /* Default horizontal layout */
    flex-wrap: wrap; /* Allow wrapping */
    gap: 20px; /* Space between items */
    
}

.test-tube {
    position: relative;
   width: calc(25% - 20px); /* 4 tubes per row on large screens */
    min-width: 150px; /* Minimum width */
    margin-bottom: 30px;
    padding-top:180px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tube-body {
    width: 40px;
    height: 150px;
    border-radius: 0 0 40px 40px;
    position: relative;
    overflow: hidden;
    border: 2px solid #333;
    border-top: none;
    
}



.thermometer {
    position: absolute;
    width: 8px;
    height: 200px;
  
    background-color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -120px;
    z-index: 0;
}

.mercury {
    position: absolute;
    bottom: 5px;
    left: 1px;
    width: 6px;
    background-color: #e74c3c;
    border-radius: 3px;
    transition: height 1s linear;
}

.temperature-display {
    margin-top: 10px;
    font-weight: bold;
    font-size: 18px;
}

.controls {
    margin: 30px auto;
}

button {
  padding: 12px 24px; /* Larger touch targets */
    min-width: 100px; /* Minimum button width */
    font-size: 1rem;
    
    margin: 0 10px;
    
    cursor: pointer;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #27ae60;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#stopwatch {
  font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-block;
    margin: 20px 0;
    letter-spacing: 2px;
   
    
}

/* Tube colors */
.black { background-color: #333 !important; }
.white { background-color: #fff !important; }
.silver { background-color: #c0c0c0 !important; background-image: linear-gradient(to right, #c0c0c0, #e0e0e0, #c0c0c0) !important; }
.clear { background-color: rgba(200, 200, 255, 0.3) !important; }

#help-button{
  position: fixed;
  border: none;
  color: white;
  top: 20px;
  left: 20px;
  background-color: #3498db;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  width: 40px;
   height: 40px;
  
}

#reset-btn {
   background-color: #3498db;
}

/* Media queries for different screen sizes */
@media (max-width: 1024px) { /* Tablet landscape */
    .test-tube {
        width: calc(33% - 20px); /* 3 tubes per row */
    }
}

@media (max-width: 768px) { /* Tablet portrait */
    .test-tube {
        width: calc(50% - 20px); /* 2 tubes per row */
    }
    
    .experiment-container {
        justify-content: center; /* Center tubes */
    }
}

@media (max-width: 480px) { /* Mobile */
    .test-tube {
        width: 100%; /* 1 tube per row */
        max-width: 200px;
    }
   .controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    button {
        width: 100%;
    }
}
