.gfx-panel, .gp-quip, .gp-fake, .gfx-mute {
  --gfx-top: calc(12px + env(safe-area-inset-top, 0px));
  --gfx-right: calc(12px + env(safe-area-inset-right, 0px));
  --gfx-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  --gfx-left: calc(12px + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  font: 400 16px/1.4 "Obcoro Display Pixel", monospace;
  font-synthesis: none;
  overflow-wrap: anywhere;
}
.gfx-panel {
  position: fixed;
  inset: var(--gfx-top) var(--gfx-right) var(--gfx-bottom) var(--gfx-left);
  width: min(420px, calc(100% - var(--gfx-left) - var(--gfx-right)));
  max-width: none;
  max-height: calc(100dvh - var(--gfx-top) - var(--gfx-bottom));
  margin: auto;
  padding: clamp(18px, 5vw, 26px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #52805f;
  border-radius: 0;
  background: #040b09f7;
  color: #70f995;
  color-scheme: dark;
  text-align: start;
}
.gfx-panel:not([open]) { display: none; }
.gfx-panel::backdrop { background: rgb(1 7 7 / 80%); }
.gfx-title {
  margin: 0;
  color: #9affb1;
  font: inherit;
  font-size: 26px;
  line-height: 1.3;
}
.gfx-message { margin: 10px 0 0; white-space: pre-line; }
.gfx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #2a6940;
}
.gfx-actions button, .gp-fake, .gfx-mute {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #52805f;
  border-radius: 0;
  background: #07100c;
  color: #70f995;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}
.gfx-mute {
  flex: none;
  padding-block: 5px;
  font-size: inherit;
  white-space: nowrap;
}
.gfx-mute[aria-pressed="true"] { color: #a3c2ab; border-style: dashed; }
.gfx-mute.gfx-corner {
  position: fixed;
  z-index: 12;
  bottom: var(--gfx-bottom);
  left: var(--gfx-left);
  padding: 7px 8px;
  font-size: 14px;
}
.gfx-actions button { flex: 1 1 8rem; font: inherit; }
.gfx-actions .gfx-primary {
  position: relative;
  isolation: isolate;
  border: 0;
  background: transparent;
  color: #fa785c;
  font-size: 18px;
}
.gfx-primary::before, .gfx-primary::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  background: #fa785c;
}
.gfx-primary::after { inset: 1px; background: #26130e; }
.gfx-actions button:focus-visible, .gp-fake:focus-visible, .gfx-mute:focus-visible {
  outline: 2px solid #9affb1;
  outline-offset: 2px;
}
@media (hover: hover) {
  .gfx-actions button:not(.gfx-primary):hover, .gp-fake:hover, .gfx-mute:hover { border-color: #70f995; background: #11271b; }
  .gfx-primary:hover::after { background: #402019; }
}

@media (prefers-reduced-motion: no-preference) {
  .gfx-panel[open][data-result="clear"] { animation: gfx-clear 420ms ease-out; }
  .gfx-panel[open][data-result="fail"] { animation: gfx-fail 320ms ease-out; }
}
@keyframes gfx-clear {
  from { border-color: #9affb1; box-shadow: 0 0 22px rgb(112 249 149 / 45%); }
}
@keyframes gfx-fail {
  15% { transform: translateX(-3px); border-color: #fa785c; background-color: #25120f; }
  45% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

.gp-fake { scroll-margin: var(--gfx-top) var(--gfx-right) var(--gfx-bottom) var(--gfx-left); }
.gp-quip, .gp-fake.gp-corner {
  position: fixed;
  z-index: 12;
  top: var(--gfx-top);
  right: var(--gfx-right);
  max-width: min(17rem, calc(100% - var(--gfx-left) - var(--gfx-right)));
}
.gp-quip {
  margin: 0;
  padding: 6px 10px;
  border-left: 2px solid #52805f;
  background: #040b09ed;
  color: #9affb1;
  font-size: 14px;
  text-align: start;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: none;
}
