:root {
      --green: #8bd400;
      --dark: #0f0f0f;
      --card: #ffffff;
      --gray: #f4f4f4;
    }

    * {
      box-sizing: border-box
    }

    body {
      margin: 0;
      font-family: Inter, sans-serif;
      background: #eee;
      color: #111;
    }

    /* ================= HEADER ================= */
    header {
      background: #eee;
      border-bottom: 1px solid #ddd;
      padding: 10px 50px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    header .siteHead {
      font-size: 20px;
      font-weight: 900;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    header .siteHead img {
      height: 48px;
      width: auto;
    }

    .siteHead .siteLink {
      text-decoration: none;
      color: inherit;
      font-weight: bold;
    }


    header nav a {
      margin-left: 20px;
      text-decoration: none;
      color: #333;
      font-weight: 600;
    }

    /* ================= LAYOUT ================= */
    .wrapper {
      max-width: 1200px;
      margin: 30px auto;
      padding: 20px;
      background: #fff;
      border-radius: 20px;
      display: grid;
      grid-template-columns: 4fr 6fr;
      /* 40:60 ratio */
      align-items: start;
      /* Fix layout shift */
      gap: 30px;
    }

    /* ================= PREVIEW ================= */
    .preview-box {
      background: #fff;
      /* Remove side padding */
      border-radius: 16px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    canvas {
      width: 100%;
      /* Reduced width */
      max-width: 100%;
      /* Allow full width */
      background: #8bd400;
      border-radius: 8px;
    }

    .btn {
      border: none;
      padding: 14px 24px;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      margin-top: 15px;
      position: relative;
      overflow: hidden;
      transition: all 0.3s ease;
    }

    .btn::after {
      content: '';
      position: absolute;
      top: -50%;
      left: -60%;
      width: 20%;
      height: 200%;
      background: rgba(255, 255, 255, 0.4);
      transform: rotate(30deg);
      transition: all 0s;
      opacity: 0;
    }

    .btn:hover::after {
      left: 140%;
      opacity: 1;
      transition: all 0.6s ease-in-out;
    }

    .btn-green {
      background: #2f3a4a;
      color: #fff;
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn-dark {
      background: #2f3a4a;
      color: #fff;
    }

    .btn-sm {
      padding: 8px;
      border-radius: 8px;
      border: 1px solid #ccc;
      cursor: pointer;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }

    .btn-sm:hover {
      background: #f0f0f0;
      border-color: #999;
    }

    .btn-sm:active {
      background: #e0e0e0;
      transform: scale(0.95);
    }

    .btn-sm.active {
      background: var(--green);
      color: #fff;
      border-color: var(--green);
    }

    /* ================= CONTROLS ================= */
    .controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }

    .card {
      background: #fff;
      border: 1px solid #e5e5e5;
      padding: 16px;
      border-radius: 14px;
    }

    .card h3 {
      margin: 0 0 10px;
      font-size: 14px;
      font-weight: 700;
    }

    /* inputs */
    textarea {
      width: 100%;
      height: 60px;
      font-size: 16px;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid #ccc;
    }

    select,
    input[type=number] {
      width: 100%;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid #ccc;
    }

    .color-row {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .color {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 2px solid #ddd;
      cursor: pointer;
      position: relative;
    }

    .toggle-row {
      display: flex;
      gap: 10px;
    }

    .toggle-row button {
      padding: 8px 14px;
      border-radius: 8px;
      border: 1px solid #ccc;
      cursor: pointer;
      background: #fff;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .toggle-row button.active {
      background: var(--green);
      color: #fff;
      border-color: var(--green);
    }

    input[type=range] {
      width: 100%;
    }

    .effect-options {
      margin-top: 10px;
      display: flex;
      gap: 10px;
    }

    /* ================= FOOTER ================= */
    footer {
      text-align: center;
      padding: 30px;
      color: #666;
      font-size: 14px;
    }

    /* ================= RESPONSIVE ================= */
    @media(max-width:900px) {
      .wrapper {
        display: flex;
        flex-direction: column;
        padding: 15px;
        gap: 20px;
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
        border-radius: 0;
        align-items: stretch;
      }

      .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
      }

      .card {
        width: 100%;
      }

      .preview-box {
        width: 100%;
      }

      canvas {
        width: 100% !important;
        height: auto;
      }

      .actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-top: 20px;
      }

      .btn {
        width: 100%;
      }
    }

    @media(max-width:600px) {
      .controls {
        display: flex;
        flex-direction: column;
      }
    }

    @media(min-width: 901px) {
      .preview-box {
        position: sticky;
        top: 20px;
        z-index: 10;
        align-self: start;
      }

      .controls {
        overflow-y: auto;
      }
    }

    .siteContent {
      max-width: 800px;
      margin: 40px auto;
      padding: 0 20px;
    }

    .siteContent h1,
    h2 {
      font-size: 24px;
    }

    .siteContent p {
      font-size: 18px;
      line-height: 30px;
    }

    .siteContent h2 {
      margin-top: 30px;
    }


    /* ===== COMMON RANGE RESET ===== */
    input[type="range"] {
      -webkit-appearance: none;
      appearance: none;
      width: 80%;
      height: 6px;
      border-radius: 10px;
      background: linear-gradient(90deg, #7c3aed, #ec4899);
      outline: none;
      cursor: pointer;
      margin-bottom: 10px;
    }

    /* ===== TRACK (Chrome / Safari / Edge) ===== */
    input[type="range"]::-webkit-slider-runnable-track {
      height: 6px;
      border-radius: 10px;
    }

    /* ===== TRACK (Firefox) ===== */
    input[type="range"]::-moz-range-track {
      height: 6px;
      border-radius: 10px;
      background: linear-gradient(90deg, #7c3aed, #ec4899);
    }

    /* ===== THUMB (Chrome / Safari / Edge) ===== */
    input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 22px;
      height: 22px;
      background: #ffffff;
      border: 3px solid #7c3aed;
      border-radius: 50%;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      margin-top: -8px;
      /* center thumb */
    }

    /* Hover → zoom out slightly */
    input[type="range"]:hover::-webkit-slider-thumb {
      transform: scale(0.85);
      box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.2);
    }

    /* ===== THUMB (Firefox) ===== */
    input[type="range"]::-moz-range-thumb {
      width: 22px;
      height: 22px;
      background: #ffffff;
      border: 3px solid #7c3aed;
      border-radius: 50%;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    input[type="range"]:hover::-moz-range-thumb {
      transform: scale(0.85);
      box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.2);
    }

    .emoji-item {
      cursor: pointer;
      padding: 5px;
      font-size: 20px;
      text-align: center;
      border-radius: 5px;
      transition: background 0.2s;
    }

    .emoji-item:hover {
      background: #eee;
    }

    .template-card {
      background: #fff;
      border-radius: 12px;
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 2px solid transparent;
    }

    .template-card:hover {
      transform: translateY(-5px);
      border-color: var(--green);
    }

    .template-preview {
      height: 120px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      font-size: 20px;
      text-align: center;
      padding: 10px;
    }

    .file-upload-label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      padding: 12px;
      background: white;
      border: 2px dashed #ccc;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 700;
      color: #555;
      transition: all 0.2s;
    }

    .file-upload-label:hover {
      background: #f9f9f9;
      border-color: var(--green);
      color: var(--dark);
    }

    .content-divider {
      border: none;
      border-top: 2px dashed #999;
      margin: 30px 40px;
    }