* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #e0e0e0;
    color: #333;
  }
  
  header {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
    border-radius: 12px;
    margin: 10px;
  }
  
  header h1 {
    font-size: 1.8em;
    font-weight: bold;
  }
  .logo a {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    transition: all 0.3s ease;
    align-items: center;
    gap: 10px; /* Add space between icon and text */
  }

  .logo {
    font-size: 1.5rem; /* Slightly smaller size */
    font-weight: bold;
    color: #333;
    letter-spacing: 2px; /* Add some spacing between letters */
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
  }
  
  .logo .highlight {
    color: #ff7f50; /* Accent color for "LA" */
    font-weight: bold;
    letter-spacing: 1px; /* Slightly tighter spacing for "LA" */
  }
  .toolbar {
    display: flex;
    gap: 5px; /* Reduce gap between buttons */
  justify-content: flex-end; /* Align to the right */
  flex-wrap: nowrap; /* Ensure items stay in one line */
  width: 100%;
  }
  
  .toolbar input,
  .toolbar button {
    padding: 8px 10px; /* Reduce padding for smaller size */
    font-size: 0.9em; /* Adjust font size for mobile */  
    border: none;
    outline: none;
    border-radius: 12px;
    background: #e0e0e0;
    box-shadow: 4px 4px 8px #b8b8b8, -4px -4px 8px #ffffff;
    transition: 0.3s ease;
    cursor: pointer;
  }
  
  .toolbar input:focus,
  .toolbar button:hover {
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  }
  .toolbar input {
    max-width: 50px; /* Ensure input doesn't stretch */
    text-align: center;
  }
  
  .toolbar button {
    flex: 1 1 auto; /* Allow buttons to shrink */
  }
  .toolbar button.active {
    background: #d1d1d1;
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
    color: #007bff;
  }
  
  main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  #canvas {
    display: grid;
    grid-template-columns: repeat(40, 12px);
    grid-template-rows: repeat(20, 20px);
    gap: 1px;
    padding: 20px;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  }

  /*Style for context menu (add to your CSS)*/
.context-menu {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  display: none;
  z-index: 1000;
}

.undo-btn {
  padding: 8px 12px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.undo-btn:hover {
  background: #f0f0f0;
}

  .cell {
    width: 12px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 1px;
    text-align: center;
    line-height: 20px;
    font-size: 20px;
    font-family: monospace; /* Use a monospace font for ASCII art */
    cursor: pointer;
    user-select: none;
    box-shadow: 2px 2px 4px #b8b8b8, -2px -2px 4px #ffffff;
    transition: 0.3s ease;
  }
  
  .cell:hover {
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  }
  
  footer {
    background: #e0e0e0;
    text-align: center;
    padding: 20px;
    box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
    border-radius: 12px;
    margin: 10px;
  }
  
  footer p {
    font-size: 0.9em;
  }
  /* Responsive Design */
@media (max-width: 768px) {
  
    header {
        flex-wrap: nowrap; /* Prevent header elements from wrapping */
        flex-direction: column;
        align-items: center; /* Center align on mobile */
    }
  
    header h1 {
      text-align: center;
      margin-bottom: 15px;
    }
  
    .toolbar {
        justify-content: space-between; /* Distribute buttons evenly */
        gap: 5px;
    }
  
    .toolbar input,
  .toolbar button {
    flex: 1 1 20%; /* Ensure all items take up equal width */
    max-width: 25%; /* Cap the width to ensure it fits in one line */
  }
  header h1 {
    margin-bottom: 10px;
  }
  }

  

/* ====== Animation panel ====== */
.workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px;
}

#animation-panel {
  width: calc(40 * 12px + 2 * 20px + 50px);
  max-width: 95vw;
  background: #e0e0e0;
  border-radius: 12px;
  box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  padding: 14px;
}

.anim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.anim-controls-left,
.anim-controls-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.anim-btn {
  padding: 8px 10px;
  font-size: 0.9em;
  border: none;
  outline: none;
  border-radius: 12px;
  background: #e0e0e0;
  box-shadow: 4px 4px 8px #b8b8b8, -4px -4px 8px #ffffff;
  transition: 0.2s ease;
  cursor: pointer;
}

.anim-btn:hover {
  box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
}

.anim-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.anim-btn.primary {
  color: #007bff;
  font-weight: 600;
}

.anim-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  padding: 8px 10px;
  border-radius: 12px;
  background: #e0e0e0;
  box-shadow: 4px 4px 8px #b8b8b8, -4px -4px 8px #ffffff;
}

.anim-field input {
  width: 90px;
  padding: 6px 8px;
  border: none;
  outline: none;
  border-radius: 10px;
  background: #e0e0e0;
  box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  text-align: center;
}

.anim-field.wide {
  flex: 1 1 220px;
}

.anim-field.wide input[type="range"] {
  width: 100%;
}

.timeline {
  background: #e0e0e0;
  border-radius: 12px;
  box-shadow: inset 4px 4px 8px #b8b8b8, inset -4px -4px 8px #ffffff;
  padding: 12px;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 10px;
}

.timeline-title {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.timeline-hint {
  font-size: 0.8em;
  opacity: 0.75;
}

.timeline-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 6px;
  border-radius: 12px;
  background: #dedede;
  box-shadow: inset 2px 2px 5px #b8b8b8, inset -2px -2px 5px #ffffff;
}

.timeline-frame {
  min-width: 120px;
  border: none;
  border-radius: 12px;
  padding: 8px;
  background: #e0e0e0;
  box-shadow: 4px 4px 8px #b8b8b8, -4px -4px 8px #ffffff;
  cursor: pointer;
  text-align: left;
}

.timeline-frame.selected {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.timeline-frame.dragover {
  outline: 2px dashed #007bff;
  outline-offset: 3px;
}

.frame-preview {
  font-family: monospace;
  font-size: 10px;
  line-height: 1.1;
  background: #d8d8d8;
  border-radius: 10px;
  padding: 6px;
  box-shadow: inset 2px 2px 4px #b8b8b8, inset -2px -2px 4px #ffffff;
  margin-bottom: 6px;
  white-space: pre;
}

.frame-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75em;
  opacity: 0.85;
}

.timeline-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.timeline-meta {
  font-size: 0.85em;
  opacity: 0.85;
}

/* Make main not hard-center so the animation panel fits on shorter screens */
main {
  align-items: flex-start;
  padding-top: 10px;
}
