/* Extracted unchanged from prototype/twistris.html. */
:root {
  --bg: #efe3c6;
  --ink: #1a1510;
  --muted: #7a6845;
  --line: #c9b27a;
  --scene: #e9d9b0;
  --sky-top: #f1e3bf;
  --sky-bottom: #cfa958;
  --ray: rgba(212, 165, 60, 0.16);
  --grid: #8b6a2c;
  --edge: #2a1f10;
  /* Falling piece with the shape aid: Shinbashi-iro, the Taisho-era synthetic turquoise.
     No layer color shares its hue (OKLab dE about 0.2 or more to all six, also under deuteranopia). */
  --piece: #4fc3d4;
  --piece-plain: #f7eed6; /* round-1 ivory, shape aid off */
  --piece-line: #15110b; /* union outline of the piece */
  --preview-line: #15110b; /* outline of twist-preview landing ghosts */
  --plate: #15110b;
  --plate-ink: #e9d8a6;
  --plate-muted: #8c7a52;
  --key: #2a2215;
  --key-down: #3d321f;
  --key-ink: #e9d8a6;
  --sel: #d4a53c;
  --drop: #b8322a;
  --drop-ink: #f7eed6;
  --card: #f6ecd4f2;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0906;
    --ink: #eadfc0;
    --muted: #93815a; /* 4.9:1 on the dark card (was 4.49:1) */
    --line: #3a2e18;
    --scene: #130f09;
    --sky-top: #221a0c;
    --sky-bottom: #0a0806;
    --ray: rgba(212, 165, 60, 0.09);
    --grid: #8b6a2c;
    --edge: #d4a53c;
    /* Falling piece with the shape aid: Shinbashi-iro, the Taisho-era synthetic turquoise.
     No layer color shares its hue (OKLab dE about 0.2 or more to all six, also under deuteranopia). */
    --piece: #4fc3d4;
    --piece-plain: #f7eed6; /* round-1 ivory, shape aid off */
    --piece-line: #15110b; /* union outline of the piece */
    --preview-line: #15110b; /* outline of twist-preview landing ghosts */
    --plate: #15110b;
    --plate-ink: #e9d8a6;
    --plate-muted: #8c7a52;
    --key: #2a2215;
    --key-down: #3d321f;
    --key-ink: #e9d8a6;
    --card: #15110bf2;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b0906;
  --ink: #eadfc0;
  --muted: #93815a;
  --line: #3a2e18;
  --scene: #130f09;
  --sky-top: #221a0c;
  --sky-bottom: #0a0806;
  --ray: rgba(212, 165, 60, 0.09);
  --grid: #8b6a2c;
  --edge: #d4a53c;
  /* Falling piece with the shape aid: Shinbashi-iro, the Taisho-era synthetic turquoise.
     No layer color shares its hue (OKLab dE about 0.2 or more to all six, also under deuteranopia). */
  --piece: #4fc3d4;
  --piece-plain: #f7eed6; /* round-1 ivory, shape aid off */
  --piece-line: #15110b; /* union outline of the piece */
  --preview-line: #15110b; /* outline of twist-preview landing ghosts */
  --plate: #15110b;
  --plate-ink: #e9d8a6;
  --plate-muted: #8c7a52;
  --key: #2a2215;
  --key-down: #3d321f;
  --key-ink: #e9d8a6;
  --card: #15110bf2;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Josefin Sans',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* HUD */
#hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
}
.stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
/* Score grows widest; Level and Layers stay short. */
.stat:has(#score) {
  flex: 1.5;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.stat b {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Piece previews (Hold, Next): a framed window with its label set into the top rule,
   like a cartouche, so the HUD stays one 46 px row on a 390 px phone. */
.preview {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 2px;
  background: var(--scene);
  border: 1px solid var(--line);
  color: inherit;
}
.preview canvas {
  display: block;
  width: 40px;
  height: 40px;
}
.preview span {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 3px;
  background: var(--bg);
  font-size: 11px;
  line-height: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
/* Empty hold slot: a faint inner key-line marks the place. */
.hold.empty canvas {
  box-shadow:
    inset 0 0 0 7px var(--scene),
    inset 0 0 0 8px var(--line);
}
/* Hold already used by this piece. */
.hold[aria-disabled='true'] {
  opacity: 0.4;
  cursor: default;
}
/* Top-down view toggle: looking down into the pit. Gold when on. */
#viewBtn {
  width: 42px;
  height: 42px;
  border-radius: 3px;
  background: var(--plate);
  color: var(--plate-ink);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(212, 165, 60, 0.35);
}
#viewBtn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
#viewBtn[aria-pressed='true'] {
  background: var(--sel);
  color: var(--plate);
}
#pauseBtn {
  width: 42px;
  height: 42px;
  border-radius: 3px;
  background: var(--plate);
  color: var(--plate-ink);
  font-size: 13px;
  letter-spacing: -1px;
}

/* Stage */
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 12px;
  overflow: hidden;
  border: 3px double var(--sel);
  background:
    repeating-conic-gradient(from -90deg at 50% 14%, var(--ray) 0 3deg, transparent 3deg 11deg),
    radial-gradient(ellipse 90% 60% at 50% 14%, var(--sky-top) 0%, transparent 70%),
    linear-gradient(var(--sky-top), var(--sky-bottom));
}
#stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#stage::before {
  content: '';
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 1;
  border: 1px solid var(--sel);
  opacity: 0.55;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
/* The hint line sits between the two view roundels. */
#hint {
  z-index: 2;
  position: absolute;
  left: 66px;
  right: 66px;
  bottom: 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}
/* View turn buttons, pinned to the pit's bottom corners: a gold key-line roundel (outer
   rule plus an inset hairline, like the double rule on the stage frame) over the sky. */
.cam {
  z-index: 2;
  position: absolute;
  bottom: 12px;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--scene) 72%, transparent);
  border: 1px solid var(--sel);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--scene) 72%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--sel) 60%, transparent);
}
#camL {
  left: 12px;
}
#camR {
  right: 12px;
}
.cam svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.cam.down,
.cam:active {
  background: var(--sel);
  color: #15110b;
}
#toasts {
  z-index: 2;
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  letter-spacing: 0.06em;
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 7px 14px;
  border-radius: 2px;
  background: var(--plate);
  color: var(--plate-ink);
  animation: toast 1.3s ease-out forwards;
}
.toast.gold {
  background: var(--sel);
  color: #15110b;
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }
  12% {
    opacity: 1;
    transform: none;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Overlay */
#overlay {
  z-index: 3;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: color-mix(in srgb, var(--scene) 55%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#overlay[hidden] {
  display: none;
}
.card {
  max-width: 360px;
  max-height: 100%;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 20px 18px;
  color: var(--ink);
}
.card h1 {
  font-family: Limelight, 'Poiret One', system-ui, sans-serif;
  font-weight: 400;
  font-size: 34px;
  margin: 0 0 6px;
  letter-spacing: 0.14em;
  color: var(--sel);
  text-align: center;
  text-shadow: 0 1px 0 var(--ink);
}
.card h1 i {
  font-style: normal;
}
.card .rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sel), transparent);
  margin: 0 0 12px;
}
.card p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}
.card ul {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
}
.card li {
  margin-bottom: 5px;
}
.card .big {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 34px;
  color: var(--ink);
  margin: 4px 0 2px;
}
.card .keys {
  font-size: 12px;
  margin-top: 12px;
  margin-bottom: 0;
}
@media (hover: none) {
  .card .keys {
    display: none;
  }
}
.row {
  display: flex;
  gap: 8px;
}
.primary,
.secondary {
  flex: 1;
  height: 48px;
  border-radius: 3px;
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.12em;
  border: 1px solid var(--sel);
}
.primary {
  background: var(--drop);
  color: var(--drop-ink);
}
.secondary {
  background: var(--key);
  color: var(--key-ink);
}
/* Pause card: "View aids" caption and its row of three toggles. Pressed = gold fill, as the
   top-down button; unpressed keeps the dark key with its gold key-line. Fits one row at
   390 px (two-line labels if needed), wraps on anything narrower. */
.card .label {
  margin: 14px 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.row.vis {
  flex-wrap: wrap;
}
.row.vis .secondary {
  flex: 1 1 88px;
  min-width: 0;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0.06em;
}
.row.vis .secondary[aria-pressed='true'] {
  background: var(--sel);
  color: var(--plate);
  box-shadow:
    inset 0 0 0 2px var(--plate),
    inset 0 0 0 3px var(--sel);
}

/* Pause card -> Controls screen: a ruled table of actions with a key cell and a pad cell
   (dark keys with the gold key-line, like the plate), the DAS/ARR rules below. Three
   columns fit 390 px; the action name wraps rather than scrolling sideways. */
.ctl-open {
  margin-top: 10px;
}
.card.controls {
  width: 100%;
}
.card .ctl-title {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  margin-bottom: 4px;
}
.card .ctl-help {
  font-size: 13px;
  text-align: center;
}
.ctl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 68px;
  gap: 4px 6px;
  align-items: center;
  border-top: 1px solid var(--sel);
  border-bottom: 1px solid var(--sel);
  padding: 6px 0;
}
.ctl-head {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.ctl-head:first-child {
  text-align: left;
}
.ctl-name {
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bind {
  height: 36px;
  min-width: 0;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--key);
  color: var(--key-ink);
  box-shadow: inset 0 0 0 1px rgba(212, 165, 60, 0.35);
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bind.capturing {
  background: var(--sel);
  color: var(--plate);
  box-shadow:
    inset 0 0 0 2px var(--plate),
    inset 0 0 0 3px var(--sel);
}
.card .slide {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
  margin-top: 6px;
}
.slide output {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
}
.card.controls input[type='range'] {
  display: block;
  width: 100%;
  margin: 4px 0 2px;
  accent-color: var(--sel);
}
.card.controls input[type='range']:focus-visible {
  outline: 3px solid var(--sel);
  outline-offset: 2px;
}
.card .ctl-status {
  min-height: 1.45em;
  margin: 8px 0;
  font-size: 13px;
  color: var(--ink);
}

/* Controls plate */
#controls {
  margin: 10px 12px 12px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--sel);
  background: var(--plate);
  color: var(--plate-ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
button {
  font: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button:focus-visible {
  outline: 3px solid var(--sel);
  outline-offset: 2px;
}
.k {
  background: var(--key);
  color: var(--key-ink);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(212, 165, 60, 0.35);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.05s;
}
.k.down {
  background: var(--key-down);
  transform: translateY(1px) scale(0.97);
}
.k small {
  display: block;
  font-size: 11px;
  color: var(--plate-muted);
  margin-top: 4px;
}
.k svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.twistbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px 54px 54px 44px;
  gap: 6px;
  height: 48px;
}
.laylabel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  border-radius: 3px;
  border: 1px dashed var(--plate-muted);
  font-size: 13px;
  color: var(--plate-muted);
}
/* "/ 12": the pit height, quieter than the layer number. */
#layOf {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
/* The phone row leaves the label about 80 px: tighter type so "Layer 12 / 12" fits. */
@media (max-width: 420px) {
  .laylabel {
    gap: 2px;
    font-size: 12px;
  }
  .laylabel .swatch {
    width: 8px;
    margin-right: 1px;
    border-radius: 1px;
  }
  #layOf {
    font-size: 10px;
    letter-spacing: 0;
  }
}
.laylabel b {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-size: 16px;
  color: var(--plate-ink);
}
.swatch {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--sel);
}
.tw {
  background: var(--sel);
  color: #15110b;
  font-size: 22px;
  font-weight: 700;
  box-shadow: none;
}
.tw.down {
  background: #e6c000;
}
/* Twists left: a gold box with a small caption over the number. */
.twists {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  border-radius: 3px;
  color: var(--sel);
  border: 2px solid var(--sel);
}
.twists .cap {
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plate-muted);
}
#charges {
  display: block;
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.bump {
  animation: bump 0.35s;
}
@keyframes bump {
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

.pads {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 48px);
  gap: 5px;
}
.dpad .k:nth-child(1) {
  grid-area: 1/2;
}
.dpad .k:nth-child(2) {
  grid-area: 2/1;
}
.dpad .k:nth-child(3) {
  grid-area: 2/2;
  font-size: 13px;
}
.dpad .k:nth-child(4) {
  grid-area: 2/3;
}
.dpad .k:nth-child(5) {
  grid-area: 3/2;
}
.rots {
  display: grid;
  grid-template-columns: repeat(2, minmax(62px, 80px));
  grid-template-rows: repeat(2, 73px);
  gap: 6px;
}
#drop {
  background: var(--drop);
  color: var(--drop-ink);
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
}
#drop.down {
  filter: brightness(0.9);
}
@media (max-height: 640px) {
  .dpad {
    grid-template-rows: repeat(3, 40px);
  }
  .rots {
    grid-template-rows: repeat(2, 61px);
  }
  .twistbar {
    height: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    letter-spacing: 0.06em;
    animation-duration: 2s;
  }
  .bump {
    animation: none;
  }
}

/* Key hints: the bound key in a button's top-right corner, desktop only (input.js injects
   <span class="keyhint"> from its KEYS table). :is() lifts this over `.preview span`. */
:is(button, .preview) > .keyhint {
  display: none;
  position: absolute;
  top: 3px;
  right: 4px;
  left: auto;
  transform: none;
  padding: 0;
  background: none;
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--plate-muted);
  pointer-events: none;
}
@media (hover: hover) {
  :is(button, .preview) > .keyhint:not([hidden]) {
    display: block;
  }
  button:not(.cam, .preview):has(> .keyhint) {
    position: relative;
  }
}
.preview > .keyhint,
.cam > .keyhint {
  color: var(--muted);
}
/* The Hold window's corner is its canvas and its top rule carries the label, so the hint
   is set into the bottom rule at the right, like a second cartouche. */
.preview > .keyhint {
  top: auto;
  bottom: -5px;
  right: 2px;
  padding: 0 2px;
  background: var(--bg);
}
.cam > .keyhint {
  top: -4px;
  right: -4px;
}
.tw > .keyhint {
  color: rgba(21, 17, 11, 0.6);
}
#drop > .keyhint {
  color: color-mix(in srgb, var(--drop-ink) 70%, transparent);
}

/* A pad in use (body.pad, set by input.js) shows its button names on every device, phones
   included: corner hints, the pit's camera hint and the title card's controls line. */
body.pad :is(button, .preview) > .keyhint {
  display: block;
}
body.pad :is(button, .preview) > .keyhint[hidden] {
  display: none;
}
body.pad button:not(.cam, .preview):has(> .keyhint) {
  position: relative;
}
body.pad #hint .hint-keys {
  display: inline;
}
body.pad #hint .hint-touch {
  display: none;
}
body.pad .card .keys {
  display: block;
}
/* Pad focus moves between card buttons by script, so show it as keyboard focus is shown. */
body.pad #overlay :is(button, input, select):focus {
  outline: 3px solid var(--sel);
  outline-offset: 2px;
}

/* A held soft drop must not turn into a browser pan (which fires pointercancel). */
#soft {
  touch-action: none;
}

/* Camera hint under the pit: keys on hover-capable devices, gestures on touch. */
#hint .hint-keys {
  display: none;
}
@media (hover: hover) {
  #hint .hint-keys {
    display: inline;
  }
  #hint .hint-touch {
    display: none;
  }
}

/* Twist preview readout, floating over the top of the pit (step 5). Absolutely positioned
   so showing it never moves the twist buttons under the player's finger. */
#twistReadout {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  padding: 4px 12px;
  border: 1px solid var(--sel);
  border-radius: 3px;
  background: var(--plate);
  color: var(--sel);
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
#twistReadout[hidden] {
  display: none;
}
#twistReadout.bad {
  color: var(--muted);
  border-color: var(--muted);
}

/* Selected-layer tag in the pit (render.js places it beside the layer, outside the pit):
   a small black cartouche with a gold double rule, the layer's height color, a "LAYER"
   caption over the number. Refused (a held twist that can't happen): muted rule, red cross. */
#layerTag {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  pointer-events: none;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 4px;
  padding: 3px 6px 3px 4px;
  border: 1px solid var(--sel);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 2px var(--plate),
    inset 0 0 0 3px color-mix(in srgb, var(--sel) 55%, transparent);
  background: var(--plate);
  color: var(--plate-ink);
  white-space: nowrap;
  will-change: transform;
}
#layerTag .sw {
  grid-row: 1 / 3;
  width: 8px;
  height: 20px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px var(--sel);
}
#layerTag .cap {
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sel);
}
#layerTag b {
  font-family: 'Poiret One', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}
#layerTag.refused {
  border-color: var(--muted);
  border-style: dashed;
  box-shadow: none;
  color: var(--plate-muted);
}
#layerTag.refused .cap {
  color: var(--plate-muted);
}
#layerTag.refused::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(45deg, transparent 42%, var(--drop) 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--drop) 42% 58%, transparent 58%);
}
