
    body {
      font-family: "Segoe UI", sans-serif;
      background: linear-gradient(135deg, #f6f8fa, #e1e5eb);
      text-align: center;
      margin: 0;
      padding: 20px;
      min-height: 100vh;
    }

    h1 {
      color: #333;
      margin-bottom: 10px;
      text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    }

    .subtitle {
      color: #666;
      margin-bottom: 20px;
    }

    .controls {
      margin: 10px 0 20px;
      display: flex;
      justify-content: center;
      gap: 15px;
    }

    button {
      padding: 10px 20px;
      font-size: 16px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      background-color: #0078d7;
      color: white;
      transition: all 0.2s;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    button:hover {
      background-color: #005fa3;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    button:active {
      transform: translateY(0);
    }

    #start {
      background-color: #28a745;
    }

    #start:hover {
      background-color: #218838;
    }

    #reset {
      background-color: #dc3545;
    }

    #reset:hover {
      background-color: #c82333;
    }

    .game-container {
      display: flex;
      max-width: 1200px;
      margin: 0 auto;
      gap: 20px;
    }

    #objects-palette {
      width: 150px;
      background: white;
      border-radius: 10px;
      padding: 15px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .palette-title {
      font-weight: bold;
      margin-bottom: 15px;
      color: #444;
    }

    .palette-object {
      width: 60px;
      height: 60px;
      margin: 10px auto;
      border-radius: 8px;
      cursor: grab;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      transition: transform 0.2s;
    }

    .palette-object:hover {
      transform: scale(1.05);
    }

    #game-board {
      position: relative;
      flex: 1;
      height: 60vh;
      background: #ffffff;
      border: 2px solid #ccc;
      border-radius: 10px;
      overflow: hidden;
    .object {
      position: absolute;
      cursor: grab;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      transition: transform 0.3s ease;
      z-index: 10;
    }
      transition: transform 0.3s ease;
      z-index: 10;
    }

    /* Object types */
    .ball {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: radial-gradient(circle at 30% 30%, #ff4d4d, #b30000);
      box-shadow: 0 3px 8px rgba(179, 0, 0, 0.3);
    }

    .switch {
      width: 70px;
      height: 40px;
      border-radius: 20px;
      background: linear-gradient(145deg, #ffc107, #ff9800);
      box-shadow: 0 3px 8px rgba(255, 152, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding: 0 5px;
    }

    .switch-knob {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: white;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
      transition: transform 0.3s;
    }

    .switch.active .switch-knob {
      transform: translateX(30px);
    }

    .gate {
      width: 80px;
      height: 30px;
      border-radius: 5px;
      background: linear-gradient(145deg, #4caf50, #2e7d32);
      box-shadow: 0 3px 8px rgba(46, 125, 50, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 14px;
    }

    .gate.open {
      background: linear-gradient(145deg, #9e9e9e, #757575);
    }

    .connector {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #6c757d;
      box-shadow: 0 2px 5px rgba(108, 117, 125, 0.3);
      z-index: 5;
    }

    .connector-line {
      position: absolute;
      background: #6c757d;
      height: 3px;
      transform-origin: 0 0;
      z-index: 1;
    }

    .instructions {
      color: #555;
      margin-top: 20px;
      font-size: 15px;
      max-width: 800px;
      margin-left: auto;
      margin-right: auto;
      background: white;
      padding: 15px;
      border-radius: 8px;
      box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    /* Animation effects */
    .active {
      transform: scale(1.1);
      box-shadow: 0 0 15px rgba(0,0,0,0.3);
    }

    .ball-rolling {
      animation: roll 0.5s linear infinite;
    }

    @keyframes roll {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .pulse {
      animation: pulse 1s infinite;
    }

    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.1); }
      100% { transform: scale(1); }
    }

    /* Status display */
    .status {
      margin: 15px 0;
      font-weight: bold;
      color: #333;
      min-height: 24px;
    }

    .chain-progress {
      width: 80%;
      height: 10px;
      background: #e9ecef;
      border-radius: 5px;
      margin: 15px auto;
      overflow: hidden;
    }

    .progress-bar {
      height: 100%;
      background: linear-gradient(to right, #28a745, #20c997);
      width: 0%;
      transition: width 0.5s;
    }
