      .game-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 1200px;
        gap: 15px;
        margin: 20px auto; /* More margin for centering */
        padding: 15px;
      }
      .game-header {
        padding: 15px 25px;
        border-radius: 10px;
        text-align: center;
      }
      .game-header h1 {
        margin: 0 0 10px 0;
        color: #1a202c; /* Darker, more modern text color */
        font-size: 1.8em;
        font-weight: 600; /* Slightly bolder */
      }
      .challenge-display {
        font-size: 1.2rem;
        background-color: beige;
      }
      .challenge-display,
      .stats-display-container {
        font-size: 0.95em; /* Slightly larger for readability */
        color: #4a5568; /* Softer text color */
        margin-bottom: 5px;
      }
      .challenge-description {
        font-weight: 600; /* Bolder challenge description */
        color: #2b6cb0; /* A nice blue */
      }
      .stats-grid {
        display: grid;
        grid-template-columns: repeat(
          auto-fit,
          minmax(170px, 1fr)
        ); /* Wider items, responsive */
        gap: 8px 15px; /* Row and column gap */
        font-size: 0.9em;
        margin-top: 10px;
      }
      .stat-item {
        background-color: #edf2f7; /* Light gray background for stats */
        padding: 6px 10px;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        color: #2d3748;
      }

      .game-container {
        display: flex;
        flex-direction: column; /* Default for mobile */
        gap: 25px; /* Increased gap */
        width: 100%;
        min-height: 600px; /* Increased min height */
      }
      @media (min-width: 768px) {
        /* Tablet and above */
        .game-container {
          flex-direction: row; /* Side-by-side layout */
        }
      }

      .simulation-area {
        flex-basis: 100%; /* Full width on mobile */
        display: flex;
        flex-direction: column; /* Floors stack vertically */
        background-color: #e2e8f0; /* Lighter gray for simulation bg */
        border: 1px solid #cbd5e1; /* Softer border */
        border-radius: 10px;
        padding: 15px;
        position: relative; /* For elevator shaft positioning */
        min-height: 450px; /* Increased min height */
        overflow: hidden; /* Crucial for elevator shaft */
        box-sizing: border-box;
      }
      @media (min-width: 768px) {
        .simulation-area {
          flex-basis: 38%; /* Slightly more space for simulation */
        }
      }

      .floor {
        flex-grow: 1; /* Make floors share space equally */
        border-bottom: 2px solid #b8c2cc; /* Softer border */
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px; /* Padding for content */
        background-color: #f7fafc; /* Lighter floor background */
        box-sizing: border-box;
        position: relative; /* For z-indexing if needed */
        min-height: 60px; /* Minimum height for a floor */
      }
      .floor:last-child {
        border-bottom: none;
      }
      .floor-label {
        font-weight: 600;
        color: #374151; /* Dark gray for label */
        font-size: 0.95em;
      }
      .elevator-shaft {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 80px; /* Slightly wider shaft */
        height: 100%;
        top: 0;
        /* background: rgba(0,0,0,0.02); Optional: subtle shaft background */
        z-index: 1; /* Ensure shaft is behind car but above floor contents if needed */
      }

      /* --- Enhanced Elevator Car and Internals --- */
      .elevator-car {
        width: 100px;
/*         min-height: 170px; */
        background: linear-gradient(
          145deg,
          #e0e0e0,
          #c0c0c0
        ); /* Metallic silver gradient */
        border: 1px solid #a0a0a0; /* Darker border for depth */
        border-top: 2px solid #f0f0f0; /* Highlight on top edge */
        position: absolute;
        bottom: 0; /* Starts at the bottom of the shaft */
        left: 5px; /* Centered in 80px shaft ( (80-70)/2 ) */
        transition: bottom 0.5s linear; /* Smooth movement */
        color: #333; /* Darker text for better contrast on silver */
        border-radius: 6px 6px 2px 2px; /* Slightly more defined top radius */
        box-shadow: 0 0 3px rgba(0, 0, 0, 0.2) inset,
          /* Inner shadow for depth */ 0 5px 10px rgba(0, 0, 0, 0.3); /* Outer shadow for lift */
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Children align to top, button panel uses margin-top: auto */
        padding: 4px; /* Slightly more padding */
        z-index: 2; /* Car should be above the shaft visuals */
      }

      .elevator-display-panel {
        /* Top panel for floor & direction */
        display: flex;
        justify-content: space-between; /* Space out arrows and floor num */
        align-items: center;
        width: calc(100% - 4px); /* Fit within padding */
        padding: 3px 5px;
        background-color: #333a45; /* Dark, slightly glossy panel */
        border-radius: 4px;
        margin-bottom: 4px;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
      }
      .elevator-display-panel .directionindicator {
        font-size: 1em; /* Clearer arrows */
        color: #8892a0; /* Dimmed inactive color */
        line-height: 1;
        transition: color 0.2s ease-in-out, text-shadow 0.2s ease-in-out;
      }
      .elevator-display-panel .directionindicator .fas {
        /* Assuming Font Awesome */
        color: inherit; /* Inherit color from parent for easier state change */
      }
      .elevator-display-panel .directionindicator.activated {
        color: #2dd4bf; /* Bright teal for active */
        text-shadow: 0 0 5px #2dd4bf, 0 0 10px #2dd4bf;
      }
      .elevator-display-panel .floorindicator {
        font-family: "Orbitron", sans-serif; /* Digital-looking font */
        font-size: 1.3em; /* Larger floor number */
        font-weight: 700;
        color: #f5f5f5; /* Bright white/off-white */
        background-color: transparent; /* No separate bg, part of panel */
        padding: 0 3px;
        border-radius: 2px;
        text-shadow: 0 0 3px #f5f5f5;
        line-height: 1;
      }
      .elevator-display-panel .floorindicator span {
        color: inherit;
      }

      .elevator-status-panel {
        /* Panel for passenger count */
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        font-size: 0.75em;
        color: #d1d5db; /* Light gray text on dark panel */
        padding: 2px 0;
        margin-bottom: 4px;
        width: calc(100% - 4px);
        background-color: rgba(40, 40, 40, 0.5); /* Semi-transparent dark */
        border-radius: 3px;
      }
      .elevator-status-panel .elevator-passengers-label {
        font-weight: normal;
        color: #a0aec0;
      }
      .elevator-status-panel .elevator-passengers {
        font-weight: bold;
        color: #e2e8f0;
      }

      #elevatorCarPassengerArea {
        /* Area for passenger icons */
        width: calc(100% - 4px);
        flex-grow: 1; /* Allows this area to take up available space */
        min-height: 35px; /* Minimum space for a few icons */
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center; /* Vertically center icons if not full */
        overflow: hidden; /* Hide overflow if too many passengers for UI */
        padding: 3px;
        /* Subtle texture for passenger area */
        background-image: linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
          linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
          linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
          linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
        background-size: 8px 8px;
        background-color: #d1d1d1; /* Fallback color */
        border-radius: 3px;
        border: 1px solid #b0b0b0;
        gap: 2px; /* Gap between passenger icons */
        margin-bottom: 4px; /* Space before button panel */
      }
      #elevatorCarPassengerArea .person-icon {
        width: 12px; /* Slightly larger icons in car for better visibility */
        height: 12px;
      }
      #elevatorCarPassengerArea .person-icon svg {
        fill: #4a5568; /* Dark gray fill for passengers */
        stroke: #2d3748; /* Even darker stroke */
        stroke-width: 0.5px; /* Thinner stroke for small icon */
        display: block; /* Helps with alignment/sizing issues */
      }

      .buttonindicator {
        /* Panel for internal floor buttons */
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px; /* More gap between buttons */
        padding: 4px;
        background-color: #505864; /* Darker panel for buttons */
        border-radius: 4px;
        width: calc(100% - 4px);
        max-height: 38px; /* Accommodate slightly larger buttons, allows for 2 rows of small buttons */
        overflow-y: auto; /* Scroll if many floors */
        margin-top: auto; /* Pushes this panel to the bottom of the flex container (.elevator-car) */
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
      }
      .buttonindicator::-webkit-scrollbar {
        width: 5px;
      }
      .buttonindicator::-webkit-scrollbar-thumb {
        background-color: #8892a0;
        border-radius: 3px;
      }

      .buttonpress {
        /* Individual floor button inside elevator */
        font-size: 0.75em;
        color: #e0e0e0;
        background: linear-gradient(
          180deg,
          #718096,
          #4a5568
        ); /* Gradient for button */
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #2d3748; /* Dark border */
        box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); /* Subtle top highlight */
        cursor: default; /* Not clickable by user directly in this context */
        min-width: 12px; /* Ensure even single digit numbers have some width */
        text-align: center;
        line-height: 1.3;
        transition: background 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
      }
      .buttonpress.activated {
        background: linear-gradient(
          0deg,
          #f6ad55,
          #ed8936
        ); /* Orange gradient for active */
        color: #422006; /* Dark text on orange */
        font-weight: bold;
        border-color: #c05621;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 5px #f6ad55; /* Inner shadow and glow */
      }
      /* --- End Elevator Car --- */
	.controls-area {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  @media (min-width: 768px) {
    .controls-area {
      flex-basis: 62%;
    }
  }

  .code-editor-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111827;
    border-bottom: 1px solid #374151;
    padding: 0;
  }

  .editor-tabs {
    display: flex;
  }

  .editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #1f2937;
    border-right: 1px solid #374151;
    color: #9ca3af;
    font-size: 12px;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .editor-tab.active {
    background-color: #1a202c;
    color: #e2e8f0;
    border-bottom: 2px solid #3b82f6;
  }

  .tab-icon {
    font-size: 12px;
  }

  .tab-name {
    font-weight: 500;
  }

  .editor-actions {
    padding: 8px 16px;
  }

  .editor-info {
    color: #6b7280;
    font-size: 11px;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .editor-container {
    display: flex;
    height: 500px;
    background-color: #1a202c;
  }

  .line-numbers {
    background-color: #111827;
    color: #6b7280;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 8px;
    text-align: right;
    user-select: none;
    border-right: 1px solid #374151;
    min-width: 45px;
    white-space: pre;
    overflow-y: auto;
  }

  #userCode {
    flex-grow: 1;
    height: 100%;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    border: none;
    outline: none;
    resize: none;
    background-color: #1a202c;
    color: #e2e8f0;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    tab-size: 2;
  }

  /* Syntax highlighting colors */
  #userCode {
    caret-color: #3b82f6;
  }

  /* Scrollbar styling for webkit browsers */
  #userCode::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  #userCode::-webkit-scrollbar-track {
    background: #1f2937;
  }

  #userCode::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
  }

  #userCode::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
  }

  /* Button panel styles */
  .button-panel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .start-button, .apply-button, .reset-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .start-button {
    background-color: #10b981;
    color: white;
  }

  .start-button:hover {
    background-color: #059669;
  }

  .apply-button {
    background-color: #3b82f6;
    color: white;
  }

  .apply-button:hover {
    background-color: #2563eb;
  }

  .reset-button {
    background-color: #ef4444;
    color: white;
  }

  .reset-button:hover {
    background-color: #dc2626;
  }


      .button-panel {
        display: flex;
        gap: 12px; /* Gap between buttons */
        flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
      }
      .button-panel button {
        padding: 12px 18px; /* Larger buttons */
        border: none;
        border-radius: 8px; /* Softer radius */
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s, transform 0.1s;
        flex-grow: 1; /* Allow buttons to share space */
        min-width: 130px; /* Minimum width for buttons */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
      }
      .button-panel button:hover {
        transform: translateY(-1px); /* Subtle hover effect */
      }
      .apply-button {
        background-color: #3182ce; /* Blue */
        color: white;
      }
      .apply-button:hover {
        background-color: #2b6cb0; /* Darker blue */
      }
      .reset-button {
        background-color: #e53e3e; /* Red */
        color: white;
      }
      .reset-button:hover {
        background-color: #c53030; /* Darker red */
      }
      .start-button {
        background-color: #38a169; /* Green */
        color: white;
      }
      .start-button:hover {
        background-color: #2f855a; /* Darker green */
      }
      .start-button:disabled,
      .apply-button:disabled,
      .reset-button:disabled {
        background-color: #a0aec0; /* Gray for disabled */
        color: #e2e8f0;
        cursor: not-allowed;
        transform: none; /* No hover effect when disabled */
      }

      .message-log {
        height: 130px; /* Taller log */
        overflow-y: auto; /* Scroll for messages */
        background-color: #2d3748; /* Dark blue-gray for log */
        border: 1px solid #4a5568; /* Matching border */
        border-radius: 8px;
        padding: 12px;
        font-size: 0.9em;
        color: #a0aec0; /* Default text color for log */
        width: 100%;
        box-sizing: border-box;
      }
      .message-log p {
        color: #e2e8f0; /* Lighter text for actual messages */
        margin-bottom: 5px;
        line-height: 1.5; /* Readability */
      }

      .person-icon {
        /* For people on floors */
        width: 20px; /* Larger on floors */
        height: 20px;
        display: inline-block; /* Allows margin and respects text flow */
        margin: 1px 2px;
        transition: opacity 0.3s ease-in-out;
        vertical-align: middle; /* Better alignment with text or other elements */
      }
      .person-icon svg {
        fill: #63b3ed; /* Brighter blue */
        stroke: #3182ce; /* Darker blue stroke */
        stroke-width: 1px;
        display: block; /* Helps with alignment/sizing issues */
      }

      .floor-waiting-area {
        display: flex;
        flex-wrap: wrap; /* Allow icons to wrap if many */
        align-items: center;
        gap: 3px; /* Small gap between icons */
      }
      .floor-buttons {
        /* Container for up/down buttons on a floor */
        display: flex;
        flex-direction: column; /* Stack up/down buttons */
        gap: 4px; /* Gap between up and down buttons */
      }
      .floor-buttons button {
        padding: 4px 7px;
        font-size: 11px; /* Small buttons */
        /* margin-left: 6px; Removed, use gap on parent */
        background-color: #e2e8f0; /* Light gray */
        border: 1px solid #cbd5e1; /* Softer border */
        border-radius: 4px;
        cursor: pointer;
        color: #4a5568; /* Dark gray text */
        transition: background-color 0.2s, border-color 0.2s;
      }
      .floor-buttons button:hover {
        background-color: #cbd5e1; /* Slightly darker on hover */
      }
      .floor-buttons button.active {
        background-color: #f6e05e; /* Yellow for active call */
        border-color: #ecc94b; /* Darker yellow border */
        color: #744210; /* Dark brown text */
      }

      .alighting-person {
        opacity: 1;
        /* Added translateY for a more dynamic effect */
        transition: opacity 0.5s ease-out 0.1s, transform 0.5s ease-out 0.1s;
        transform: scale(1.1) translateY(-3px); /* Start slightly larger and raised */
      }
      .alighting-person.fade-out {
        opacity: 0;
        transform: scale(0.7) translateY(5px); /* Shrink and move down slightly when exiting */
      }

      .toast-notification {
        position: fixed; /* Stays in viewport */
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%); /* Center horizontally */
        padding: 14px 22px; /* Comfortable padding */
        border-radius: 8px;
        color: white;
        font-size: 0.95em;
        z-index: 1000; /* Above other elements */
        opacity: 0; /* Hidden by default */
        transition: opacity 0.3s ease-in-out, bottom 0.3s ease-in-out;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Nice shadow */
        text-align: center;
      }
      .toast-notification.show {
        opacity: 1;
        bottom: 35px; /* Moves up slightly when shown */
      }
      .toast-notification.success {
        background-color: #38a169; /* Green for success */
      }
      .toast-notification.error {
        background-color: #e53e3e; /* Red for error */
      }