      *,
      *::before,
      *::after {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      :root {
        --bg: #060608;
        --surface: rgba(10, 14, 26, 0.82);
        --surface2: rgba(255, 255, 255, 0.04);
        --border: rgba(255, 255, 255, 0.08);
        --accent: #38bdf8;
        --accent2: #2563eb;
        --danger: #ff4d6d;
        --text: #e8edf5;
        --muted: #5a657a;
      }
      body,
      html {
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: var(--bg);
        font-family: "DM Sans", sans-serif;
        color: var(--text);
      }

      /* ─── INTRO ─── */
      #intro {
        position: fixed;
        inset: 0;
        z-index: 300;
        padding: 16px;
        background: radial-gradient(
          ellipse 90% 70% at 50% 40%,
          rgba(10, 14, 26, 0.97) 0%,
          #060608 100%
        );
        display: flex;
        align-items: center;
        justify-content: center;
        transition:
          opacity 0.7s ease,
          transform 0.7s ease;
      }
      #intro.hide {
        opacity: 0;
        pointer-events: none;
        transform: scale(1.04);
      }
      .intro-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 24px;
        padding: 32px 28px;
        max-width: 460px;
        width: 100%;
        text-align: center;
        backdrop-filter: blur(24px);
        box-shadow:
          0 40px 80px rgba(0, 0, 0, 0.5),
          inset 0 1px 0 rgba(255, 255, 255, 0.06);
      }
      .intro-logo {
        font-family: "Space Mono", monospace;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: 8px;
        background: linear-gradient(
          135deg,
          var(--accent) 0%,
          var(--accent2) 100%
        );
        -webkit-background-clip: text;
        color: transparent;
        margin-bottom: 5px;
      }
      .intro-sub {
        font-size: 11px;
        color: var(--muted);
        letter-spacing: 2px;
        font-weight: 500;
        margin-bottom: 26px;
      }
      .gesture-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 26px;
      }
      .gesture-item {
        background: rgba(56, 189, 248, 0.06);
        border: 1px solid rgba(56, 189, 248, 0.18);
        border-radius: 14px;
        padding: 12px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
      }
      .gi-emoji {
        font-size: 26px;
        line-height: 1;
        filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
      }
      .gi-action {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 1px;
        color: var(--accent);
      }
      .gi-label {
        font-size: 9px;
        color: rgba(56, 189, 248, 0.6);
        line-height: 1.3;
        text-align: center;
      }
      .start-btn {
        width: 100%;
        padding: 15px;
        border: none;
        border-radius: 50px;
        cursor: pointer;
        background: linear-gradient(
          135deg,
          var(--accent) 0%,
          var(--accent2) 100%
        );
        font-family: "Space Mono", monospace;
        font-size: 12px;
        font-weight: 700;
        color: #fff;
        letter-spacing: 2px;
        box-shadow: 0 0 30px rgba(56, 189, 248, 0.35);
        transition:
          transform 0.2s,
          box-shadow 0.2s;
      }
      .start-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 0 45px rgba(56, 189, 248, 0.5);
      }

      /* ─── APP ─── */
      #app {
        position: relative;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
      }
      video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scaleX(-1);
        z-index: 1;
      }
      #cam-overlay {
        position: absolute;
        inset: 0;
        background: rgba(6, 6, 8, 0.78);
        z-index: 2;
        pointer-events: none;
        transition: background 0.3s;
      }
      .grid-layer {
        position: absolute;
        inset: 0;
        z-index: 2;
        pointer-events: none;
        background-image:
          linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
          linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
        background-size: 50px 50px;
        mask-image: radial-gradient(
          ellipse 80% 70% at 50% 50%,
          black 0%,
          transparent 100%
        );
        -webkit-mask-image: radial-gradient(
          ellipse 80% 70% at 50% 50%,
          black 0%,
          transparent 100%
        );
      }
      #draw-canvas {
        position: absolute;
        inset: 0;
        z-index: 3;
        width: 100%;
        height: 100%;
      }
      #overlay-canvas {
        position: absolute;
        inset: 0;
        z-index: 4;
        width: 100%;
        height: 100%;
        pointer-events: none;
      }

      /* ─── CURSOR ─── */
      #cursor {
        position: fixed;
        pointer-events: none;
        z-index: 200;
        transform: translate(-50%, -50%);
        transition:
          width 0.18s,
          height 0.18s,
          opacity 0.2s;
      }
      #cursor-outer {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 1.5px solid var(--accent);
        box-shadow:
          0 0 14px var(--accent),
          inset 0 0 6px rgba(56, 189, 248, 0.12);
        transition:
          border-color 0.18s,
          box-shadow 0.18s;
      }
      #cursor-dot {
        position: absolute;
        width: 5px;
        height: 5px;
        background: var(--accent);
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: background 0.18s;
      }
      #eraser-cursor {
        position: fixed;
        pointer-events: none;
        z-index: 201;
        border-radius: 50%;
        border: 1.5px solid var(--danger);
        opacity: 0;
        transform: translate(-50%, -50%);
        transition: opacity 0.15s;
        box-shadow: 0 0 10px rgba(255, 77, 109, 0.4);
      }

      /* ─── STATUS ─── */
      #status {
        position: fixed;
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--surface);
        backdrop-filter: blur(24px);
        border: 1px solid var(--border);
        border-radius: 50px;
        padding: 7px 18px;
        display: flex;
        align-items: center;
        gap: 12px;
        z-index: 150;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
        white-space: nowrap;
      }
      #g-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--muted);
        transition:
          background 0.3s,
          box-shadow 0.3s;
      }
      #g-label {
        font-family: "Space Mono", monospace;
        font-size: 9px;
        color: #8899aa;
        letter-spacing: 2px;
        min-width: 76px;
      }
      .sep {
        width: 1px;
        height: 12px;
        background: var(--border);
      }
      #timer {
        font-family: "Space Mono", monospace;
        font-size: 10px;
        color: var(--accent);
        letter-spacing: 1px;
      }

      /* ─── TOOLBAR BASE ─── */
      #toolbar {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 6px;
        background: var(--surface);
        backdrop-filter: blur(28px);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 10px 14px;
        z-index: 150;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
        max-width: calc(100vw - 32px);
        overflow-x: auto;
      }
      .divider {
        width: 1px;
        height: 26px;
        background: var(--border);
        margin: 0 2px;
        flex-shrink: 0;
      }
      .divider-h {
        display: none;
      }

      /* PALETTE */
      #palette {
        display: flex;
        gap: 5px;
        align-items: center;
      }
      .swatch {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        cursor: pointer;
        flex-shrink: 0;
        border: 2px solid transparent;
        transition:
          transform 0.2s,
          border-color 0.2s,
          box-shadow 0.2s;
      }
      .swatch:hover {
        transform: scale(1.25);
      }
      .swatch.active {
        border-color: rgba(255, 255, 255, 0.85);
        transform: scale(1.18);
      }

      /* SLIDERS */
      .sl-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
      }
      .sl-icon {
        color: var(--muted);
        display: flex;
        align-items: center;
      }
      .sl-icon svg {
        width: 13px;
        height: 13px;
      }
      input[type="range"] {
        -webkit-appearance: none;
        width: 66px;
        height: 3px;
        background: rgba(255, 255, 255, 0.12);
        border-radius: 2px;
        outline: none;
        cursor: pointer;
        flex-shrink: 0;
      }
      input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: white;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
      }

      /* ICON BUTTONS */
      .ic-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: var(--surface2);
        color: var(--text);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.2s;
        flex-shrink: 0;
        position: relative;
      }
      .ic-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
      }
      .ic-btn svg {
        width: 16px;
        height: 16px;
        stroke-width: 2;
        pointer-events: none;
      }
      .ic-btn.primary {
        background: linear-gradient(135deg, var(--accent), var(--accent2));
        color: #fff;
        border: none;
      }
      .ic-btn.primary:hover {
        box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
      }
      .ic-btn.danger {
        background: rgba(255, 77, 109, 0.12);
        border-color: rgba(255, 77, 109, 0.25);
        color: var(--danger);
      }
      .ic-btn.danger:hover {
        background: var(--danger);
        color: white;
      }
      .ic-btn::after {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.88);
        color: white;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1px;
        white-space: nowrap;
        padding: 4px 8px;
        border-radius: 6px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        font-family: "Space Mono", monospace;
      }
      .ic-btn:hover::after {
        opacity: 1;
      }

      /* ─── MOBILE ─── */

      @media (min-width: 681px) {
        .tb-row {
          display: contents;
        }
        .divider-h {
          display: none;
        }
      }

      /* ─── CO-OP PANEL ─── */
      #coop-panel {
        position: fixed;
        bottom: 90px;
        right: 20px;
        width: 260px;
        background: var(--surface);
        backdrop-filter: blur(28px);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 18px;
        z-index: 160;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        display: none;
      }
      .panel-title {
        font-family: "Space Mono", monospace;
        font-size: 9px;
        letter-spacing: 3px;
        color: var(--muted);
        margin-bottom: 12px;
      }
      .peer-id-box {
        background: rgba(0, 0, 0, 0.4);
        padding: 10px;
        border-radius: 10px;
        font-family: "Space Mono", monospace;
        font-size: 15px;
        text-align: center;
        color: var(--accent);
        letter-spacing: 3px;
        margin-bottom: 14px;
      }
      .peer-input {
        display: flex;
        gap: 6px;
      }
      .peer-input input {
        flex: 1;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--border);
        color: white;
        border-radius: 10px;
        padding: 8px 12px;
        font-size: 12px;
        font-family: "Space Mono", monospace;
        outline: none;
        letter-spacing: 1px;
      }
      .peer-input input::placeholder {
        color: var(--muted);
      }
      .peer-input button {
        background: var(--accent);
        border: none;
        color: var(--bg);
        padding: 8px 12px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 11px;
        font-weight: 700;
        font-family: "Space Mono", monospace;
        transition: 0.2s;
      }
      .panel-close {
        position: absolute;
        top: 12px;
        right: 14px;
        background: none;
        border: none;
        color: var(--muted);
        cursor: pointer;
        font-size: 18px;
        line-height: 1;
      }
      .panel-close:hover {
        color: white;
      }

      /* ─── GUIDE ─── */
      #guide {
        position: fixed;
        bottom: 90px;
        left: 20px;
        width: 220px;
        background: var(--surface);
        backdrop-filter: blur(28px);
        border: 1px solid rgba(56, 189, 248, 0.15);
        border-radius: 20px;
        z-index: 150;
        overflow: hidden;
      }
      .guide-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 11px 14px;
        cursor: pointer;
        border-bottom: 1px solid rgba(56, 189, 248, 0.1);
      }
      .guide-head-title {
        font-family: "Space Mono", monospace;
        font-size: 8px;
        letter-spacing: 2px;
        color: var(--accent);
      }
      .guide-toggle-btn {
        background: none;
        border: none;
        color: var(--accent);
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
      }
      .guide-body {
        padding: 6px 14px 10px;
      }
      .g-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 5px 0;
        border-bottom: 1px solid rgba(56, 189, 248, 0.06);
      }
      .g-row:last-child {
        border-bottom: none;
      }
      .g-emoji {
        width: 30px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.45));
      }
      .g-name {
        font-size: 10px;
        font-weight: 700;
        color: var(--accent);
      }
      .g-hint {
        font-size: 8.5px;
        color: rgba(56, 189, 248, 0.55);
        margin-top: 1px;
      }
      #guide.collapsed .guide-body {
        display: none;
      }
      #guide.collapsed {
        border-radius: 50px;
      }
      #guide.collapsed .guide-head {
        border-bottom: none;
      }

      /* ─── REMOTE VIDEO ─── */
      #remote-video {
        position: fixed;
        top: 16px;
        right: 16px;
        width: 170px;
        height: 125px;
        border-radius: 14px;
        object-fit: cover;
        z-index: 160;
        border: 1.5px solid var(--accent);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
        display: none;
        background: #000;
      }

      /* ─── ZOOM BADGE ─── */
      #zoom-badge {
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.72);
        padding: 4px 14px;
        border-radius: 20px;
        font-family: "Space Mono", monospace;
        font-size: 10px;
        color: var(--accent);
        z-index: 160;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
      }

      /* ─── TOAST ─── */
      .toast {
        position: fixed;
        top: 68px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(10, 14, 26, 0.95);
        border: 1px solid var(--border);
        padding: 7px 18px;
        border-radius: 50px;
        font-size: 11px;
        font-weight: 600;
        color: var(--text);
        z-index: 500;
        letter-spacing: 0.5px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        animation: toastIn 0.25s ease;
        white-space: nowrap;
      }
      @keyframes toastIn {
        from {
          opacity: 0;
          transform: translateX(-50%) translateY(-8px);
        }
        to {
          opacity: 1;
          transform: translateX(-50%) translateY(0);
        }
      }

      /* ─── WATERMARK ─── */
      #watermark {
        position: fixed;
        bottom: 14px;
        left: 16px;
        z-index: 151;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(8px);
        padding: 5px 12px;
        border-radius: 50px;
        font-family: "Space Mono", monospace;
        font-size: 9px;
        color: rgba(255, 255, 255, 0.45);
        letter-spacing: 1px;
        text-decoration: none;
        border: 1px solid rgba(255, 255, 255, 0.06);
        transition:
          color 0.2s,
          background 0.2s,
          border-color 0.2s;
        white-space: nowrap;
        width: fit-content;
      }
      #watermark:hover {
        color: var(--accent);
        background: rgba(56, 189, 248, 0.1);
        border-color: rgba(56, 189, 248, 0.3);
      }

      /* ─── MOBILE OVERRIDES ─── */
      @media (max-width: 680px) {
        #toolbar {
          bottom: 0;
          left: 0;
          right: 0;
          transform: none;
          border-radius: 18px 18px 0 0;
          max-width: 100%;
          flex-direction: column;
          align-items: stretch;
          padding: 10px 14px env(safe-area-inset-bottom, 14px);
          gap: 8px;
          overflow-x: auto;
        }
        .tb-row {
          display: flex;
          align-items: center;
          justify-content: flex-start;
          gap: 8px;
          flex-wrap: nowrap;
          overflow-x: auto;
          padding: 4px 8px;
          -webkit-overflow-scrolling: touch;
        }
        .tb-row::-webkit-scrollbar {
          display: none;
        }
        .divider {
          display: none;
        }
        .divider-h {
          display: block;
          width: 100%;
          height: 1px;
          background: var(--border);
        }
        input[type="range"] {
          width: 72px;
        }
        .swatch {
          width: 28px;
          height: 28px;
          flex-shrink: 0;
        }
        .ic-btn {
          width: 42px;
          height: 42px;
          border-radius: 12px;
        }
        .ic-btn svg {
          width: 20px;
          height: 20px;
        }
        #guide {
          display: block;
          bottom: 110px;
          left: auto;
          right: 16px;
          width: 180px;
          box-shadow: 0 10px 30px rgba(0,0,0,0.6);
        }
        #guide .g-emoji {
          width: 24px;
          font-size: 16px;
        }
        #guide .g-name {
          font-size: 9px;
        }
        #status {
          top: 10px;
          font-size: 9px;
          padding: 6px 14px;
          gap: 10px;
        }
        #coop-panel {
          bottom: auto;
          top: 60px;
          right: 16px;
          left: 16px;
          width: auto;
          max-width: 360px;
          margin: 0 auto;
        }
        #remote-video {
          top: auto;
          bottom: 160px;
          right: 10px;
          width: 120px;
          height: 90px;
        }
        /* Mobile watermark: dipindah ke bawah agar tidak menutupi status bar */
        #watermark {
          bottom: 110px;
          top: auto;
          left: 16px;
          padding: 5px 12px;
          font-size: 9px;
          gap: 5px;
          background: rgba(0, 0, 0, 0.6);
          border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .intro-card {
          padding: 24px 20px;
          width: calc(100% - 32px);
          max-width: 380px;
        }
      }
      #watermark svg {
        width: 12px;
        height: 12px;
        stroke: currentColor;
        flex-shrink: 0;
      }