* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html, body {
      width: 100%;
      height: 100%;
      background: #1f1b18;
      color: #ede6dc;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }

    .stage-wrap {
      position: relative;
      width: min(1280px, calc(100vw - 16px), calc((100vh - 50px) * 16 / 9));
      aspect-ratio: 16 / 9;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    body.is-fullscreen .stage-wrap {
      width: min(100vw, calc(100vh * 16 / 9));
      height: min(100vh, calc(100vw * 9 / 16));
    }

    body.is-fullscreen .footer {
      position: fixed;
      bottom: 8px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(31, 27, 24, 0.72);
      padding: 4px 12px;
      border-radius: 999px;
      margin-top: 0;
      backdrop-filter: blur(4px);
    }

    canvas {
      width: 100%;
      height: 100%;
      border-radius: 10px;
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
      cursor: none;
      display: block;
      background: #e0d6c6;
    }

    body.is-fullscreen canvas {
      border-radius: 0;
      box-shadow: none;
    }

    .footer {
      margin-top: 8px;
      font-size: 13px;
      color: #b7aa99;
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: center;
    }

    .footer button,
    .footer select {
      background: #38312c;
      color: #ede6dc;
      border: 1px solid #594f47;
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 12px;
      cursor: pointer;
      transition: background 0.15s ease;
    }

    .footer button:hover,
    .footer select:hover {
      background: #4b423b;
    }

    .ctrl-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #d4c6b2;
    }
