:root{
  --left-bg:#000000;
  --right-bg:#ffffff;
  --ink-left:#ffffff;
  --muted-left:#c9c9c9;
  --line-left:#ffffff;
  --ink-right:#111111;
  --line-right:#111111;
  --accent:#ffe45c;
}

*{ box-sizing:border-box; }

html, body {
  height: 100%;
}

body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color:var(--ink-right);
  background:
    linear-gradient(
      90deg,
      var(--left-bg) 0%,
      var(--left-bg) 34%,
      var(--right-bg) 34%,
      var(--right-bg) 100%
    );
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.app{
  width:min(1100px, 100%);
  display:grid;
  grid-template-columns: 290px 1fr;
  grid-template-areas: "panel canvas";
  gap:36px;
  align-items:start;
}

.panel  { grid-area: panel; }
.canvasWrap { grid-area: canvas; }

.mobileHeader { display: none; }

.panel{
  background:transparent;
  border:none;
  border-radius:0;
  padding:18px 8px 18px 6px;
  color:var(--ink-left);
  justify-self:start;
  width:100%;
  max-width:290px;
  font-family:"Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

.sub{
  font-size:22px;
  line-height:1.25;
  color:var(--ink-left);
  margin:0 0 18px;
  letter-spacing:-0.02em;
  max-width:240px;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:18px;
  max-width:230px;
}

.chip{
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--line-left);
  cursor:pointer;
  box-shadow:none;
  transition:transform .08s ease;
  position: relative;
}

.chip::after {
  content: '';
  position: absolute;
  inset: -4px;
}

.chip:hover{ transform:translateY(-1px); }
.chip.active{
  transform:scale(1.08);
  box-shadow:0 0 0 2px rgba(255,255,255,.16);
}

.customColorBox{
  margin-bottom:16px;
  padding:14px;
  border:1px solid var(--line-left);
  border-radius:0;
  background:transparent;
  max-width:240px;
}

.customColorLabel{
  display:block;
  font-size:18px;
  font-weight:400;
  margin-bottom:12px;
  color:var(--ink-left);
  letter-spacing:-0.01em;
}

.customColorControls{
  display:grid;
  grid-template-columns: 56px 1fr;
  gap:0;
  align-items:center;
}

input[type="color"]{
  appearance:none;
  -webkit-appearance:none;
  width:56px;
  height:42px;
  border:none;
  padding:0;
  margin:0;
  background:transparent;
  cursor:pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper{ padding:0; }
input[type="color"]::-webkit-color-swatch{
  border:1px solid var(--line-left);
  border-radius:0;
}
input[type="color"]::-moz-color-swatch{
  border:1px solid var(--line-left);
  border-radius:0;
}

.hexInput{
  width:100%;
  height:42px;
  border-radius:0;
  border:1px solid var(--line-left);
  background:#000000;
  color:var(--ink-left);
  padding:0 12px;
  margin-left:-1px;
  font-family: inherit;
  font-size:15px;
  outline:none;
}

.hexInput:focus{ background:#0c0c0c; }

.btns{
  display:grid;
  gap:16px;
  max-width:240px;
}

button{
  appearance:none;
  border:1px solid var(--line-left);
  border-radius:0;
  padding:13px 14px;
  background:transparent;
  color:var(--ink-left);
  cursor:pointer;
  font-weight:700;
  font-size:16px;
  font-family: inherit;
  transition:transform .08s ease, background .08s ease, color .08s ease;
}

button:not(.chip) {
  min-height: 44px;
}

button:hover{
  transform:translateY(-1px);
  background:#111111;
}

button:active{ transform:translateY(0); }

button.primary{
  background:var(--accent);
  color:#111111;
  border-color:var(--accent);
}

.panel button.primary,
.panel button.primary:not(.chip) { color: #111111; }

button.primary:hover{
  background:#ffd93d;
  border-color:#ffd93d;
  color:#111111;
}

.small{
  margin-top:14px;
  color:var(--muted-left);
  font-size:15px;
  line-height:1.35;
  max-width:240px;
}

.canvasWrap{
  position:relative;
  padding:14px;
  display:flex;
  justify-content:center;
  align-items:center;
  background:transparent;
  overflow:hidden;
  border:none;
  border-radius:0;
}

.jarStage{
  position:relative;
  width:min(620px,100%);
  aspect-ratio:1 / 1;
  display:block;
}

.jarStage canvas,
.jarStage svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}

.jarStage svg{ pointer-events:none; overflow:visible; }

canvas{
  border-radius:0;
  background:transparent;
  touch-action:none;
  cursor:crosshair;
}

.badge{
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  color:var(--ink-right);
  pointer-events:none;
  font-family: Arial, Helvetica, sans-serif;
  z-index: 10;
}

.badgeLabel{ font-size:12px; font-weight:700; line-height:1; }

.badgeBarVertical{
  width:18px;
  height:92px;
  background:#d9d9d9;
  border:none;
  border-radius:999px;
  position:relative;
  overflow:hidden;
}

.badgeBarFillVertical{
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  height:0%;
  background:#111111;
  transition:height .15s ease;
  border-radius:0 0 999px 999px;
}

.badgeValue{ font-size:12px; font-weight:700; line-height:1; }

@media (max-width: 700px) {

  body {
    align-items: flex-start;
    padding: 0;
    padding-top: 36px;
    background:
      linear-gradient(
        180deg,
        var(--right-bg) 0%,
        var(--right-bg) 58%,
        var(--left-bg) 58%,
        var(--left-bg) 100%
      );
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "header"
      "canvas"
      "panel";
    gap: 0;
    width: 100%;
  }

  .mobileHeader {
    display: block;
    grid-area: header;
    padding: 16px 20px 10px;
    background: var(--right-bg);
    color: var(--ink-right);
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  }

  .mobileHeader .sub {
    font-size: 16px;
    line-height: 1.3;
    max-width: none;
    margin: 0;
    color: var(--ink-right);
    letter-spacing: -0.01em;
  }

  .desktopOnly { display: none; }

  .canvasWrap {
    padding: 8px 12px 12px;
    background: var(--right-bg);
  }

  .badge { color: var(--ink-right); }

  .jarStage {
    width: min(100%, calc(100vw - 24px));
    max-width: 420px;
    margin: 0 auto;
  }

  .badge {
    top: 16px;
    right: 20px;
  }

  .badgeBarVertical { height: 64px; }

  .panel {
    padding: 20px 20px 24px;
    max-width: none;
    width: 100%;
    background: var(--left-bg);
    color: #ffffff;
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  }

  .panel .sub,
  .panel .customColorLabel,
  .panel .small { color: #ffffff; }

  .panel .customColorBox { border-color: #ffffff; }

  .panel .hexInput { background: #000000; color: #ffffff; border-color: #ffffff; }

  .panel button:not(.chip) { border-color: #ffffff; color: #ffffff; }

  .panel button:not(.chip):hover { background: #111111; }

  .panel .chip { border-color: #ffffff; }

  .panel button.primary { border-color: var(--accent); }

  .chips {
    max-width: none;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(5, 40px);
    justify-content: center;
    row-gap: 12px;
    column-gap: 12px;
  }

  .chip {
    width: 40px;
    height: 40px;
    min-height: 0;
  }

  .customColorBox {
    max-width: none;
    margin-bottom: 20px;
    padding: 14px 16px;
  }

  .customColorLabel { font-size: 16px; }

  .hexInput:focus { background: #1a1a1a; }

  .btns {
    max-width: none;
    gap: 20px;
    margin-bottom: 4px;
  }

  button:not(.chip) {
    padding: 14px 16px;
    font-size: 15px;
  }

  button.primary { background: var(--accent); color: #111111; border-color: var(--accent); }
  button.primary:hover { background: #ffd93d; }

  .small { max-width: none; font-size: 14px; }
}

@media (min-width: 701px) and (max-width: 840px) {

  body {
    background:
      linear-gradient(
        180deg,
        var(--left-bg) 0%,
        var(--left-bg) 55%,
        var(--right-bg) 55%,
        var(--right-bg) 100%
      );
    align-items: flex-start;
    padding: 24px 20px;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "canvas"
      "panel";
    gap: 0;
  }

  .panel {
    max-width: none;
    padding: 20px 12px 20px;
    background: var(--right-bg);
    color: var(--ink-right);
    --ink-left: var(--ink-right);
    --line-left: var(--line-right);
    --muted-left: #555555;
  }

  .sub, .chips, .customColorBox, .btns, .small { max-width: none; }

  .chip            { border-color: #aaaaaa; }
  .customColorBox  { border-color: var(--line-right); }
  .hexInput        { background: #f5f5f5; color: var(--ink-right); border-color: #aaaaaa; }
  .hexInput:focus  { background: #eeeeee; }

  button           { border-color: var(--line-right); color: var(--ink-right); }
  button:hover     { background: #f0f0f0; }
  button.primary   { background: var(--accent); color: #111111; border-color: var(--accent); }

  .sub             { color: var(--ink-right); max-width: none; }
  .small           { color: #555555; max-width: none; }
}