/* CSS Document */

 
    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Arial, sans-serif;
      background: #10131a;
      color: #fff;
      display: flex;
      flex-direction: column;
    }

    header {
      padding: 16px;
      text-align: center;
      background: rgba(255,255,255,0.06);
      border-bottom: 1px solid rgba(255,255,255,0.12);
    }

    header h1 {
      margin: 0 0 6px;
      font-size: 22px;
    }

    header p {
      margin: 0;
      opacity: 0.75;
      font-size: 14px;
    }

    .app {
      flex: 1;
      display: grid;
      grid-template-columns: 260px 1fr;
      gap: 16px;
      padding: 16px;
      min-height: 0;
    }

    .panel {
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    }

    .panel h2 {
      font-size: 16px;
      margin: 0 0 12px;
    }

    .control-group { margin-bottom: 18px; }

    .control-group label {
      display: block;
      font-size: 13px;
      opacity: 0.8;
      margin-bottom: 8px;
    }

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

    .color-btn {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      border: 3px solid transparent;
      cursor: pointer;
      box-shadow: inset 0 -5px 0 rgba(0,0,0,0.18);
    }

    .color-btn.active {
      border-color: #fff;
      transform: scale(1.06);
    }

    .size-buttons,
    .tool-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .app button {
      border: 0;
      border-radius: 12px;
      padding: 11px 12px;
      font-weight: 700;
      cursor: pointer;
      background: rgba(255,255,255,0.16);
      color: white;
    }

    .app button:hover { background: rgba(255,255,255,0.24); }

    .app button.active {
      background: #ffffff;
      color: #10131a;
    }

    .stage-wrap {
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 22px;
      padding: 16px;
      overflow: hidden;
      position: relative;
    }

    canvas {
      width: min(86vh, 100%);
      height: min(86vh, 100%);
      max-width: 850px;
      max-height: 850px;
      background: #f1f2f5;
      border-radius: 16px;
      box-shadow: 0 18px 50px rgba(0,0,0,0.35);
      touch-action: none;
      cursor: crosshair;
    }

    .hint {
      font-size: 13px;
      line-height: 1.4;
      opacity: 0.75;
    }

    .json-box {
      width: 100%;
      min-height: 90px;
      resize: vertical;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.18);
      background: rgba(0,0,0,0.25);
      color: #fff;
      padding: 10px;
      font-size: 11px;
    }

    @media (max-width: 800px) {
      .app { grid-template-columns: 1fr; }
      .panel { order: 2; }
      .stage-wrap { order: 1; min-height: 55vh; }
      canvas { width: 100%; height: auto; }
    }
 