/*
Theme Name: Base Theme
Author: Ešer
Author ID: 1
Description: Base Theme for YOAB
Version: 0.13
Compatibility: 0.13
*/

@font-face {
  font-family: 'Vincent Praise';
  src: url('VincentPraise.woff2?v=8') format('woff2');
}
@font-face {
  font-family: 'Vincent Praise Monospace';
  src: url('VincentPraiseMono.woff2?v=0e') format('woff2');
}
@font-face {
  font-family: 'Unifont';
  src: url('unifont.woff2?v=12.0.01') format('woff2');
}

:root {
  --text-primary: #eee;
  --text-secondary: #ddd;
  --text-input: #222;
  --text-shadow: #222;
  --text-shadow-active: #eee;
  --text-link: #9ff;
  --button-border: #222;
  --background-primary: #222;
  --background-secondary: #333;
  --background-tertiary: #555;
  --background-input: #eee;
  --background-input-highlight: #cde;
  --positive: #0c0;
  --neutral: #fc0;
  --negative: #c00;
  --inactive: #ccc;
  --highlight: #0cf;
  --gradient-primary: #777;
  --gradient-secondary: #aaa;
  --canvas-transparent-primary: #222;
  --canvas-transparent-secondary: #111;

  --item-quality-stock: #A0A0A0;
  --item-quality-common: #FFFFFF;
  --item-quality-uncommon: #37BD64;
  --item-quality-rare: #60A0FC;
  --item-quality-epic: #C960ED;
  --item-quality-legendary: #F2C017;
  --item-quality-vintage: #C5995F;
  --item-quality-author: #26A4AC;
}

:root[data-theme="light"] {
  --text-primary: #222;
  --text-secondary: #444;
  --text-input: #222;
  --text-shadow: transparent;
  --text-shadow-active: transparent;
  --text-link: #099;
  --button-border: transparent;
  --background-primary: #eee;
  --background-secondary: #ddd;
  --background-tertiary: #ccc;
  --highlight: #068;
  --gradient-primary: #eee;
  --gradient-secondary: #ccc;
  --gradient-secondary: #aaa;
  --canvas-transparent-primary: #fff;
  --canvas-transparent-secondary: #ccc;
}

* {
  font-family: 'Vincent Praise', 'Comic Sans MS', 'Unifont';
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

html {
  overflow: hidden;
  height: 100%
}
body {
  margin: 0;
  overflow: hidden;
  position: absolute;
  width: 100%;
  height: 100%;
}

body.loading {
  cursor: progress;
}

a {
  color: var(--highlight);
}

input, textarea {
  background-color: var(--background-input);
  color: var(--text-input);
}

input:focus, textarea:focus {
  outline: none;
}

input:focus:not(:read-only), textarea:focus {
  animation: pulse-input 1.5s infinite;
}

ul {
  margin: 0;
}

#flex-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#flex-main>header {
  background: var(--background-primary);
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
  align-content: space-between;
  z-index: 1;
}

.borealis #flex-main>header {
  background: linear-gradient(135deg, #000 25%, #f90 25%, #f90 50%, #000 50%, #000 75%, #f90 75%);
  background-size: 32px 32px;
}

#flex-main>main {
  flex: 1;
  position: relative;
}

#container {
  background: repeating-conic-gradient(var(--canvas-transparent-primary) 0% 25%, var(--canvas-transparent-secondary) 0% 50%) 50% / 16px 16px;
  overflow: hidden;
}

#maintenance {
  display: none;
  text-align: center;
  background-color: var(--background-tertiary);
  color: var(--neutral);
}
#maintenance img {
  width: 345px;
}

@keyframes appear {
  0% {
    transform: perspective(200px) translateZ(-500px);
  }
  33% {
    transform: perspective(200px) translateZ(100px);
  }
  100% {
    transform: perspective(200px) translateZ(0px);
  }
}

@keyframes mirror {
  0% {
    transform: scaleX(0);
  }
  15% {
    transform: scaleX(1);
  }
  35% {
    transform: scaleX(1);
  }
  65% {
    transform: scaleX(-1);
  }
  85% {
    transform: scaleX(-1);
  }
  100% {
    transform: scaleX(0);
  }
}

#container .popup {
  z-index: 2;
  position: absolute;
  bottom: 40px;
  margin: 0 auto;
  height: 128px;
  width: 100%; 
  background-image: url('../res/event/padoru.png');
  background-size: 128px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: #009;
  pointer-events: none;
  animation: mirror 1s infinite;
}
#container .popup.new-entry {
  animation: mirror 1s infinite, appear 2.33s ease-out;
}
#container .popup.yipee {
  background-image: url('../res/event/yipee.png');
}

@keyframes px-spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to { transform: translate(-50%,-50%) rotate(360deg); }
 }

#spinner, #stencil.loading .spinner {
  background-image: url('../res/spinner.png');
  top: 50%;
  left: 50%;
  background-size: 100%;
  animation: px-spin 0.6s steps(4, end) infinite
}

#spinner {
  width: 96px;
  height: 96px;
  position: fixed;
}

#stencil.loading {
  background-color: var(--background-primary);
}

#stencil.loading .spinner {
  width: 32px;
  height: 32px;
  position: absolute;
}

#stencil.loading img {
  visibility: hidden;
}

.no-soap, #wrapper.grid::after {
  image-rendering: optimizeSpeed;
  -ms-interpolation-mode: nearest-neighbor;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -webkit-crisp-edges;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.no-sink, .no-sink-parent * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

canvas {
  position: relative;
}

#wrapper {
  position: absolute;
  display: inline-flex;
  margin: 0 auto;
  /*border: 1px solid white;*/
}
#wrapper.grid {
  background-size: 1px 1px;
}
#wrapper.grid.hide-grid {
  background-size: 0;
}
#wrapper.grid::after {
  content: '';
  position: absolute;
  background-size: inherit;
  background-repeat: repeat;
  background-image: 
    linear-gradient(rgba(255,255,255,0.5) var(--grid-border-width), transparent var(--grid-border-width), transparent var(--grid-border-width-neg), rgba(0,0,0,0.5) var(--grid-border-width-neg)),
    linear-gradient(90deg, rgba(255,255,255,0.5) var(--grid-border-width), transparent var(--grid-border-width), transparent var(--grid-border-width-neg), rgba(0,0,0,0.5) var(--grid-border-width-neg));
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grid-opacity);
}
/* TODO: investigate DOM event lags caused by custom cursors
#container.tool-pixel {
  cursor: url('./res/ui/pixel_cursor.png') 15 15, default;
}
#container.tool-bucket {
  cursor: url('./res/ui/bucket_cursor.png') 6 27, default;
}
#container.tool-rect {
  cursor: url('./res/ui/rect_cursor.png') 15 15, default;
}
*/
#container.cant-place {
  cursor: not-allowed;
}
#container.cant-place>:not(#wrapper) {
  cursor: default;
}
a.bait {
  display: block;
  position: absolute;
}

.modal-container {
  height: 100%;
  position: relative;
}

.modal {
  position: absolute;
  margin: 0 auto;
  padding: 4px;
  top: 100px;
  left: 0;
  right: 0;
  border-radius: 8px;
  background: linear-gradient(var(--gradient-primary), var(--gradient-secondary) 1.5em, #fff);
  color: var(--text-primary);
  scrollbar-width: none;
  width: max-content;
  max-width: 75%;
  z-index: 1;
  flex-direction: column;
  border: none;
}
div.modal, dialog.modal:open {
  display: flex;
}
.modal.sticky {
  z-index: 0;
}
dialog.modal::backdrop {
  background-color: #000a;
  backdrop-filter: blur(10px);
}
/*
.modal:not(.moving) {  
  -webkit-transition: all .1s linear 0s;
  transition: all .1s linear 0s;
}
*/
.modal.moving {
  cursor: grabbing;
}  
.modal::-webkit-scrollbar {
  display: none;
}

.modal header {
  background-position: 4px 50%;
  background-repeat: no-repeat;
  min-height: 36px;
  max-height: 36px;
}

.modal table {
  width: 100%;
  border-collapse: collapse;
}
.modal thead {
  position: sticky;
  z-index: 1;
  top: 0;
  background-color: var(--background-tertiary);
}
.modal tfoot {
  position: sticky;
  z-index: 1;
  bottom: 0;
  background-color: var(--background-tertiary);
}
.modal tbody tr:nth-child(2n+1) {
  background-color: var(--background-secondary);
}
.modal tr>* {
  padding: 0 8px;
}

.modal a {
  cursor: pointer;
  color: var(--text-link);
  text-decoration: underline;
}

.modal>header {
  display: flex;
  flex-direction: row;
}
.modal h2 {
  margin: 0 128px;
  padding: 2px;
  text-align: center;
  text-shadow: 0 4px var(--background-primary);
  flex-grow: 3;
}
.modal h4 {
  margin: 0;
  width: 100%;
  font-size: 150%;
}
.modal div:not(:first-child)>h4 {
  border-top: 1px solid var(--text-primary);
}
.modal footer {
  display: flex;
  font-style: italic;
  justify-content: space-between;
}
.modal>header button {
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  position: absolute;
  top: 0px;
  width: 32px;
  height: 32px;
  background-color: transparent;
  filter: invert();
  border-radius: 0 0 8px 8px;
}
.modal>header button:hover {
  background-color: #009;
  filter: none;
}
.modal .maximize {
  background-image: url('./base/maximize.png');
  right: 88px;
}
.modal.maximized .maximize, .modal.sticky .maximize {
  background-image: url('./base/restore.png');
}
.modal .close {
  background-image: url('./base/close.png');
  width: 80px;
  right: 8px;
}
.modal .close:hover {
  background-color: var(--negative);
}

.modal>main {
  background: var(--background-primary);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}
.modal>main>section {
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.modal .group {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-bottom: 20px;
  justify-content: center;
}
.modal .group span {
  padding-top: 7px;
}
.modal .group-vertical {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 20px;
}
.modal button,
#nsfw-popup button {
  font-size: 1em;
  padding: 4px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid var(--button-border);
  background-color: var(--background-secondary);
  color: var(--text-primary);
  border-radius: 8px;
}
.modal button.danger {
  color: var(--negative);
  border-color: var(--negative);
  font-weight: bold;
}
.modal button.scope {
  min-width: 64px;
  max-width: 64px;
}
.modal button:hover {
  background-color: var(--background-primary);
}
.modal button:active {
  border-color: #777;
  background-color: var(--background-input);
  color: var(--text-input);
}
.modal button.danger:active {
  color: var(--negative);
}
.modal input, .modal textarea {
  width: 100%;
}
.modal input[type=text], input[type=number], .modal textarea {
  border: 2px solid var(--background-input);
  border-radius: 8px;
  font-size: inherit;
  background-color: var(--background-input);
  color: var(--text-input);
  resize: none;
}
.modal textarea {
  height: 5.6em;
}

.modal.maximized, .modal.sticky {
  height: 100%;
  max-height: 100%;
  top: 0 !important;
  bottom: 0 !important;
  padding: 0;
  border-radius: 0;
  box-sizing: border-box;
}
.modal.maximized {
  max-width: 100%;
  width: 100%;
  left: 0 !important;
  right: 0 !important;
}
.modal.sticky, .modal.sticky {
  min-width: 480px;
  width: 25%;
  max-width: 25%;
}
.modal.maximized>main, .modal.sticky>main {
  height: 0; /* VERY obvious height fix! */
  flex-grow: 1;
  border-radius: 0;
  max-height: unset;
}
.modal.sticky .secondary{
  display: none;
}

ul.tab-select {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 4px;
  font-weight: bold;
  flex-wrap: wrap;
}
ul.tab-select>li {
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 8px;
  cursor: pointer;
}
ul.tab-select>li:hover {
  background-color: var(--background-secondary);
}
ul.tab-select>li.active {
  color: var(--background-secondary);
  background-color: var(--text-secondary);
}

.field {
  display: flex;
  align-items: center;
}
.field>* {
  box-sizing: border-box;
  margin: 2px;
}
.field>label {
  min-width: 30%;
  max-width: 30%;
}
.field>input {
  width: 45%;
  font-size: 1em;
}
.field>div, 
.field>span,
.field>input {
  padding: 4px;
}
.field>div.select {
  width: 70%;
  cursor: pointer;
  position: relative;
}
.field>div.select.iconed {
  background-position: 2px 50%;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-left: 24px;
}
.field>div.select::after {
  position: absolute;
  right: 0;
  width: 16px;
  height: 16px;
  content: '';
  background-position: right 2px center;
  background-repeat: no-repeat;
  background-size: 16px;
  background-image: url('./base/icon32/dropdown.png');
}
[data-theme="dark"] .field>div.select::after {
  filter: invert();
}
ul.options {
  z-index: 2;
  position: absolute;
  width: 70%;
  background: var(--background-secondary);
  border-radius: 4px;
  box-shadow: 0 0 4px #fff;
  box-sizing: border-box;
  list-style: none;
  padding: 0px; 
  max-height: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-primary);
}
ul.options li {
  border-radius: 4px;
  margin: 2px;
  cursor: pointer;
  padding: 2px 4px;
}
ul.options.iconed li {
  padding: 2px 24px;
  background-position: 0 50%;
  background-repeat: no-repeat;
  background-size: 16px;
}
ul.options li:hover {
  background-color: var(--background-primary);
}
ul.options li.selected {
  color: var(--text-input);
  background-color: var(--background-input);
}
.field>input[readonly] {
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
}
.field>button {
  content: ' ';
  flex-grow: 1;
}

.fileish-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  overflow-x: hidden;
}
.fileish-container>a {
  display: flex;
  flex-direction: column;
  margin: 4px;
  align-items: center;
  flex-grow: 1;
  text-decoration: none;
  width: 100px;
  text-align: center;
}
.fileish-container>a:hover {
  background: var(--background-secondary);
  border-radius: 8px;
}
.fileish-container>a.selected {
  background: var(--background-tertiary);
  border-radius: 8px;
}
.fileish-container>a>span {
  text-decoration: underline;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fileish-container>a>.imgc {
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.fileish-container>a>.imgc>img {
  max-width: 64px;
  max-height: 64px;
  border-radius: 8px;
}
#lang-modal .fileish-container>a>.imgc>img,
#archives-modal .fileish-container>a>.imgc>img {
  border-radius: 0;
}
.fileish-container>a>small {
  font-size: 75%;
}
.fileish-container>a>button {
  margin-top: auto;
}
.fileish-container>label {
  text-align: center;
}
#info-modal .fileish-container img,
#archives-modal .fileish-container img,
#lang-modal .fileish-container img,
#auth-modal .fileish-container img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

#notify-modal main>div {
  margin: 8px;
}

#stats-modal td, #stats-modal th {
  text-align: right;
  height: 18px;
}
#stats-modal tbody td,
#stats-modal tfoot tr>:nth-child(2) {
  font-family: 'Vincent Praise Monospace', 'Vincent Praise', 'Unifont';
}
#stats-modal tbody td {
  white-space: nowrap;
  border: 2px solid var(--background-primary)
}
#stats-modal tbody td small {
  font-family: 'Vincent Praise Monospace', 'Vincent Praise', 'Unifont';
  opacity: 0.6;
}
#stats-modal .badge.left {
  margin-right: auto;
  padding-right: 12px;
}
#stats-modal .event-place.right {
  margin-left: auto;
}
#stats-modal td.fresh {
  animation: fresh-fade 0.4s linear;
}
#stats-modal td.fresh-negative {
  animation: fresh-negative-fade 0.4s linear;
}
#stats-modal thead th:nth-child(2),
#stats-modal tbody td:nth-child(2) {
  text-align: left;
}
#stats-modal tr.me td:first-child {
  background-color: var(--text-primary);
  color: var(--background-primary);
  border-radius: 8px;
}
#stats-modal td>div {
  display: inline-block;
}
#stats-modal td .username{
  display: inline-block;
  margin-bottom: -6px;
  max-width: 150px;
  overflow-x: hidden;
  text-overflow: ellipsis;
  padding-left: 1px; /* fix cut due weird font rendering */
}
#stats-modal td>.indicator {
  margin-bottom: 0.1em;
  margin-left: 0.25em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
}
#stats-modal td>.latest-indicator {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  background-color: var(--text-primary);
  border-radius: 0px;
  margin-left: 0.25em;
  margin-top: 0.2em;
  cursor: pointer;
  opacity: 0.3;
}
#stats-modal td>.latest-indicator:hover {
  opacity: 1;
}
#stats-modal td>div.online {
  background-color: var(--positive);
}
#stats-modal td>div.idle {
  background-color: var(--neutral);
}
#stats-modal section[data-tab="pixel-stats"] td>.badge {
  margin-right: 8px;
}
#stats-modal tfoot td, #stats-modal tfoot th {
  text-align: right;
}
#auth-modal.logged-in:not(.maximized) {
  width: 680px;
}
#info-modal:not(.maximized) {
  width: 680px;
}
#chat-container .badge {
  width: 16px;
  height: 16px;
  margin: -4px 4px;
}
#top-menu {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
  background: linear-gradient(var(--gradient-secondary), var(--gradient-primary));

  padding: 0 28px 0 12px;
  margin-right: -16px;
  border-bottom-right-radius: 16px;
}
#top-menu>* {
  padding: 4px 12px 4px 48px;
  border-radius: 8px;
  margin: 4px;
  font-size: 1.5em;
  font-weight: bold;
  position: relative;
  color: var(--text-primary);  
  text-shadow: 0 2px var(--text-shadow);
  white-space: nowrap;
  background-repeat: no-repeat;
  background-size: 32px;
  background-position: 8px 50%;
}
#top-menu>*:hover {
  cursor: pointer;
  background-color: #fff8;
}
#top-menu>.active {
  background-color: #fffc;
  color: #222;  
  text-shadow: 0 2px var(--text-shadow-active);
}
#top-menu>#auth {
  overflow: hidden;
  text-overflow: ellipsis;
}
#top-menu span {
  vertical-align: middle;
  display: inline-block;
  white-space: nowrap;
}

#nickname {
  display: none;
}

#online, #idle {
  width: 48px;
  border-radius: 24px;
  text-align: center;
  margin: 0 4px;
  color: var(--text-primary);  
  text-shadow: 0 2px var(--text-shadow);  
}
#online {
  background-color: var(--positive);
}
#idle {
  background-color: var(--neutral);
}

#controls {
  margin: 0 8px;
  min-width: 300px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-grow: 1;
  flex-wrap: wrap;
}
#controls>* {
  display: flex;
  align-items: center;
}
#controls>*>div {
  display: flex;
}
#top-menu>.new::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: var(--highlight);
  right: -4px;
  top: -4px;
  position: absolute;
}
.new-highlight,
.new-highlight a {
  color: var(--highlight);
}
#controls>div {
  margin: 2px 10px;
}
#tools-group, #controls-overlay {
  position: relative;
}
#cooldown, #event-message {
  z-index: 2;
  margin: 0 auto;
  width: fit-content;
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  background-color: var(--background-primary);
  border: 2px solid var(--text-primary);
  color: var(--text-primary);
  background-position: 4px 50%;
  background-repeat: no-repeat;
  background-size: 32px;
  padding: 2px 16px 2px 48px;
  height: 42px;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 2em;
  font-weight: bold;
  text-align: center;
}
[data-theme="dark"] #cooldown.slowed {
  color: var(--neutral);
  color: color-mix(in hsl, var(--negative) var(--slowed), var(--neutral));
}
[data-theme="light"] #cooldown.slowed {
  background-color: var(--neutral);
  background-color: color-mix(in hsl, var(--negative) var(--slowed), var(--neutral));
}
#event-message sup {
  position: absolute;
  top: -8px;
  background-color: var(--positive);
  border-radius: 12px;
  color: var(--text-primary);
}
#controls span {
  display: block;
  width: 36px;
  height: 36px;
  margin: 2px;
  border-radius: 8px;
  font-size: 1.5em;
  background-color: #ccc;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 32px;
  cursor: pointer;
  box-sizing: border-box;
}
#controls span.absolute-hack {
  display: none;
  opacity: 0;
  pointer-events: none;
}  
#controls span.icon-pixel {
  text-align: right;
  font-size: 1.2em;
  font-weight: bold;
  padding: 2px 4px;
}
#controls span:hover {
  background-color: #eee;
}
#controls span.active {
  background-color: #9ff;
}
#controls span.active:hover {
  background-color: #dff;
}
#controls [disabled] {
  filter: grayscale(100%) contrast(50%);
  pointer-events: none;
}

#status-bar {
  font-weight: bold;
  height: 24px;
  padding-top: 4px;
  width: 100%;
  background: var(--background-primary);
  color: var(--text-primary);
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
#status-bar .badge {
  width: 16px;
  height: 16px;
  margin: -2px 0;
}
#swatch-controls {
  display: flex;
  margin-right: 4px;
}
#coords {
  flex-basis: 160px;
}
#placed-by {
  flex-basis: 320px;
  flex-grow: 1;
}
#lang {
  min-width: 32px;
  cursor: pointer;
  background-repeat: no-repeat;
  margin-right: 4px;
  margin-top: -7px;
}
.badge {
  width: 16px;
  height: 16px;
  margin: -2px 0;
}
.badge.glow, .cm-badge.glow {
  animation: pulse 4s infinite;
}
.palette-scrollable .icon-scrollable,
.palette-groupable .icon-groupable,
.palette-stackable .icon-stackable {
  display: none;
}
[data-theme="light"] .icon-scrollable,
[data-theme="light"] .icon-groupable,
[data-theme="light"] .icon-stackable {  
  filter: invert();
}

.control-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  background: linear-gradient(var(--gradient-secondary), var(--gradient-primary));
}
.control-bar .tool-modes-group {
  display: flex;
}
.control-bar button {
  cursor: pointer;
  white-space: nowrap;
  margin: 4px 2px;
  border: none;
  padding: 4px;
  background-color: var(--background-secondary);
  color: var(--text-primary);
  border-radius: 8px;
}
.control-bar button:hover {
  background-color: var(--background-primary);
}
.control-bar button.active {
  background-color: var(--highlight);
  color: var(--background-primary);
}

#palette-container .control {
  display: inline-block;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  min-width: calc(32px * var(--palette-size));
  height: calc(32px * var(--palette-size));
  position: relative;
  cursor: pointer;
  margin: 4px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: calc(32px * var(--palette-size));
}
#palette-container .control:hover {
  background-color: #fff8;
}
footer:not(.palette-scrollable) #palette-container .control {
  display: none;
}
#swatch-controls>* {
  width: 24px;
  height: 18px;
  position: relative;
  padding: 0 2px;
  margin: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
}
#swatch-controls>*::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-position: right 2px top -3px;
  background-repeat: no-repeat;
  filter: opacity(50%) invert();
}
#swatch-controls>*:hover::after {
  filter: invert();
}
#swatch-controls>.dark::after {
  filter: opacity(50%);
}
#swatch-controls>.dark:hover::after {
  filter: unset;
}
#swatch-foreground, #swatch-background {
  width: 56px;
  color: rgba(0,0,0,0.7);
  background: linear-gradient(135deg, white 45%, #c66 45%, #c66 55%, white 55%);
}
#swatch-foreground:not(.not-selected)::after {
  background-image: url('./base/close.png');
}
#swatch-background::after {
  background-image: url('./base/swap.png');
}
#palette {
  margin: 0 auto;
  text-align: center;
  vertical-align: middle;
  scrollbar-width: none;
  position: relative;
}
#palette::-webkit-scrollbar {
  display: none;
}
#controls-expand {
  display: none;
}
.palette-scrollable #palette {
  white-space: nowrap;
  overflow-x: scroll;
}
.palette-groupable span[data-group] {
  display: inline-block;
  cursor: pointer;
  height: calc(32px * var(--palette-size));
  border-radius: 50%;
  margin: 0 2px;
}
.palette-groupable span[data-group]:not(.expanded) {
  width: calc(32px * var(--palette-size));
  margin-top: 3px;
}
footer:not(.palette-groupable) span[data-group], 
.palette-groupable span[data-group].expanded {
  background: none !important;
}
.swatch {
  display: inline-block;
  width: calc(32px * var(--palette-size));
  height: calc(32px * var(--palette-size));
  position: relative;
  color: rgba(0,0,0,0.7);
  cursor: pointer;
  padding: 2px;
  margin: 2px;
  border-radius: 4px;
  white-space: initial;
  vertical-align: bottom;
  line-height: 80%;
  font-size: calc(1em * var(--palette-size));
  font-weight: bold;
}
.swatch-transparent {
  background:
    linear-gradient(var(--color), var(--color)),
    repeating-conic-gradient(var(--canvas-transparent-primary) 0% 25%, var(--canvas-transparent-secondary) 0% 50%) 50% / 16px 16px
    !important; 
}
.swatch.admin {
  font-style: italic;
}
.swatch.admin:not(.active) {
  display: none;
}
.palette-groupable span[data-group]:not(.expanded)>.swatch {
  display: none;
}
.swatch.dark, #swatch-controls>.dark,
[data-theme="dark"] .swatch.theme-dark,
[data-theme="dark"] #swatch-controls>.theme-dark {
  color: rgba(255,255,255,0.7);
}

.swatch:hover {
  border: 2px solid rgba(0,0,0,0.5);
  border-bottom-width: calc(8px * var(--palette-size) + 2px);
  height: calc(24px * var(--palette-size));
  margin: 0;
}
.swatch.dark:hover,
[data-theme="dark"] .swatch.theme-dark:hover {
  border: 2px solid rgba(255,255,255,0.5);
  border-bottom-width: calc(8px * var(--palette-size) + 2px);
}

.swatch.active {
  border: 2px solid black;
  border-bottom-width: calc(8px * var(--palette-size) + 2px);
  height: calc(24px * var(--palette-size));
  margin: 0;
}
.swatch.active.dark,
[data-theme="dark"] .swatch.active.theme-dark {
  border-color: white;
}

#overlay>* {
  position: absolute;
  display: none;
  top: 0px;
  left: 0px;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

#overlay>*.active, #overlay>#links {
  display: block;
}
#overlay>#links {
  pointer-events: unset;
}

#nsfw-popup {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  text-align: center;
  width: 100%;
  height: 100%;
  background-color: #222;
  color: #fff;
  z-index: 20;
}
@supports (backdrop-filter: blur()) {
  #nsfw-popup {
    background-color: #000a;
    backdrop-filter: blur(10px);
  }
}
#nsfw-popup.active{
  display: flex;
}
#nsfw-popup>h2 {
  font-size: 2em;
  text-transform: uppercase;
}
#nsfw-popup>p {
  max-width: 600px;
  padding-left: 20px;
  padding-right: 20px;
}
#nsfw-popup>button {
  font-size: 1.5em;
  cursor: pointer;
  padding: 10px 10px 10px 45px;
}

#cursor {
  position: absolute;
  pointer-events: none;
  animation: pulse 1.5s infinite;
}
.cursor-guide {
  position: absolute;
  pointer-events: none;
  animation: pulse-mid 3s infinite;
}
#cursor.selected-area {
  box-shadow: 0 0 0 1px var(--background-primary);
  outline: 1px dashed var(--text-primary);
}
#cursor.selected-area-locked {
  outline: none;
  box-shadow: 0 0 0 max(100vw, 100vh) #888c;
  animation: none;
}

@keyframes pulse-mid {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.3;
  }
}
@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}
@keyframes pulse-hard {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes pulse-input {
  0% {
    background: var(--background-input);
  }
  50% {
    background: var(--background-input-highlight);
  }
  100% {
    background: var(--background-input);
  }
}
@keyframes gae {
  0% {
    background-position: 0px 0px;
  }
  100% {
    background-position: -200px 0px;
  }
}
@keyframes fresh-fade {
  0% {
    background-color: #0c04;
  }
  100% {
    background-color: #0c00;
  }
}
@keyframes fresh-negative-fade {
  0% {
    background-color: #c004;
  }
  100% {
    background-color: #c000;
  }
}

#chat-container {
  position: absolute;
  text-align: center;
}
#chat-container>*{
  position: absolute;
}
#chat-container input{
  font-size: inherit;
  width: 200px;
  border: 2px solid var(--background-input);
  border-radius: 8px;
}
#chat-container>div{
  background: var(--background-primary);
  color: var(--text-primary);
  border: 4px solid var(--text-primary);
  border-radius: 0 20px 20px 20px;
  white-space: nowrap;
  padding: 4px;
}
#chat-container>div b{
  cursor: pointer;
}
#chat-container>.simple-pin {
  width: 8px;
  height: 8px;
  border-width: 12px;
  border-color: var(--neutral);
  outline: 2px solid var(--background-primary);
  background-color: var(--background-primary);
  animation: pulse-hard 1s infinite;
}
#chat-container .emoji {
  width: 32px;
  height: 32px;
  background-size: contain;
  margin-bottom: 4px;
}
#chat-container .color {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  margin-bottom: 4px;
}
#chat-container .close{
  --angle: 0%;
  font-size: 1em;
  margin-left: 4px;
  color: white;
  background: conic-gradient(red var(--angle), maroon var(--angle));
  animation: 3s rotate linear;
  display: inline-block;
  border-radius: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

#chat-modal main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
#chat-modal main>section {
  position: relative;
  overflow-y: unset;
}
#chat-message-container {
  overflow-x: hidden;
  overflow-y: auto;
}
#chat-message-container .divider {
  text-align: center;
  position: sticky;
  top: 0;
  background: var(--background-primary);
  z-index: 1;
}
#chat-message-container>:nth-child(2n) {
  background: var(--background-secondary);
}
.chat-message.highlight {
  box-shadow: 0 0 0 200px #f608 inset
}
.chat-message.mention-me {
  box-shadow: 0 0 0 200px #06f8 inset
}
.chat-message {
  padding: 2px;
  position: relative;
  padding-right: 36px;
}
.chat-message>* {
  display: inline-block;
  margin-right: 0.25em;
}
/* used for stencil titles to display instead of url */
.hidden-content {
  user-select: all;
  font-size: 0;
  color: transparent;
}
[data-displayed-content]::after {
  content: attr(data-displayed-content);
}
.cm-time {
  font-family: 'Vincent Praise Monospace', 'Vincent Praise', 'Unifont';
  color: var(--text-secondary);
}
.cm-badge {
  width: 16px;
  background-position: center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}
.cm-author {
  font-weight: bold;
  padding-left: 0.25em;
  cursor: pointer;
  text-shadow: -1px 0 0 var(--text-outline), 1px 0 0 var(--text-outline), 0 1px 0 var(--text-outline), 0 -1px 0 var(--text-outline), -1px -1px 0 var(--text-outline), 1px 1px 0 var(--text-outline), -1px 1px 0 var(--text-outline), 1px -1px 0 var(--text-outline);
}
[data-theme="dark"] :not(.fill):not(.dark)>.cm-author, :not(.fill).light>.cm-author {
  --text-outline: #0008;
}
[data-theme="light"] :not(.fill):not(.light)>.cm-author, :not(.fill).dark>.cm-author {
  --text-outline: #fff8;
}
.glow>.cm-author{
  animation: pulse 4s infinite;
}
.cm-author.shrunk {
  margin-right: -0.25em;
}
.chat-message>.cm-badge-name {
  display: inline-flex;
  align-items: stretch;
  vertical-align: bottom;
}
.cm-badge-name {
  border: 1px solid transparent;
  background-clip: padding-box;
  border-radius: 0.5em;
  padding-left: 0.25em;
}
.cm-badge-name.fill, .cm-badge-name.border {
  padding-right: 0.25em;
}
.cm-badge-name.fill.dark {
  color: white;
}
.cm-badge-name.fill.light {
  color: black;
}
.cm-content {
  display: inline;
  color: var(--text-secondary);
}
.cm-content.service {
  color: var(--highlight);
  font-weight: bold;
}
.cm-pin {
  width: 16px;
  height: 16px;
  background-image: url('./base/icon16/location.png');
  background-size: 100%;
  position: absolute;
  top: 5px;
  right: 5px;
  cursor: pointer;
  background-repeat: no-repeat;
}
#chat-message-input {
  box-sizing: border-box;
  padding-right: 40px;
}
#chat-location-toggle, #chat-emoji-toggle {
  width: 32px;
  height: 32px;
  position: absolute;
  right: 4px;
}
#chat-location-toggle {
  top: 4px;
}
#chat-emoji-toggle {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  bottom: 4px;
}
ul#chat-suggestions {
  position: absolute;
  bottom: 0;
  z-index: 2;
  margin: 0 0 5.8em;
  background: var(--background-tertiary);
  border-radius: 4px;
  box-shadow: 0 0 4px #fff;
  list-style: none;
  padding: 0px;
  max-height: 400px;
  overflow-y: auto;
}
ul#chat-suggestions li {
  padding: 2px 16px;
  border-radius: 4px;
  margin: 2px;
  cursor: pointer;
  white-space: nowrap;
}
ul#chat-suggestions li.active {
  background-color: var(--background-secondary);
}
ul#chat-suggestions li .status {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
}
ul#chat-suggestions li.min {
  padding: 2px;
  display: inline-block;
}
ul#chat-suggestions li .status.online {
  background-color: var(--positive);
}
ul#chat-suggestions li .status.idle {
  background-color: var(--neutral);
}
ul#chat-suggestions li .status.offline {
  background-color: var(--inactive);
}
ul#chat-suggestions li .emojiname {
  margin: 0 0.25em;
}
ul#chat-suggestions li .emojitag {
  opacity: 0.7;
  font-style: italic;
}

u.wavy {
  text-decoration-style: wavy;
}
u.double {
  text-decoration-style: double;
}
q {
  quotes: none;
  color: #488c38;
}
.timestamp {
  background-color: var(--background-tertiary);
  border-radius: 2px;
}
footer .timestamp {
  background-color: transparent;
}
.spoiler {
  border-radius: 4px;
  background-color: #777;
}
.spoiler:not(.revealed) {
  color: transparent !important;
  cursor: pointer;
}
.spoiler:not(.revealed) * {
  color: transparent !important;
  background: none !important;
}
.spoiler:hover {
  background-color: #aaa;
}
.spoiler.revealed {
  color: var(--text-primary);
}
.mention {
  font-weight: bold;
  color: var(--highlight);
}
.gae {
  animation: gae 1.5s linear infinite;
  background-image: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200px;
  background-repeat: repeat;
}
.emoji {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-size: contain;
  vertical-align: bottom;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  user-select: all;
  font-size: 0;
}

.color {
  cursor: pointer;
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  vertical-align: bottom;
  color: transparent;
  user-select: all;
  font-size: 0;
}

.emoji::selection,
.color::selection {
  color: transparent;
}
.emoji.h {
  transform: scaleX(-1);
}

.group button {
  white-space: nowrap;
}
button.iconed {
  padding-left: 40px;
  background-repeat: no-repeat;
  background-position: 4px 50%;
}
button.iconed.small {
  padding-left: 24px;
}
button.icon-only {
  background-repeat: no-repeat;
  background-position: center;
}
button.icon-only::after {
  content: '\00a0';
}
button:disabled {
  opacity: 0.5;
}

.max-bucket-radius {
  outline: var(--max-bucket-radius) solid var(--max-bucket-background);
}

#stencil.editing {
  box-shadow: 0 0 0 1px var(--background-primary);
  outline: 1px dashed var(--highlight);
  pointer-events: unset;
}

#stencil img {
  width: 100%;
  height: 100%;
  position: absolute;
}
#stencil.editing img {
  cursor: grab;
}
#stencil img.active {
  cursor: grabbing;
}

#stencil .resize-handle {  
  animation: pulse 1.5s infinite;
  width: 16px;
  height: 16px;
  border: 1px solid var(--background-primary);
  background: var(--inactive);
  position: absolute;
  z-index: 2;
}
#stencil .resize-handle.horizontal {
  cursor: ew-resize; 
}
#stencil .resize-handle.vertical {
  cursor: ns-resize; 
}
#stencil .resize-handle.nesw {
  cursor: nesw-resize; 
}
#stencil .resize-handle.nwse {
  cursor: nwse-resize; 
}
#stencil .resize-handle:hover {
  animation: none;
  background: var(--highlight);
}
#stencil .resize-handle.active {
  animation: none;
  background: var(--neutral);
}

#stencil-file-upload {
  display: none;
}

.inventory-flex-container {
  position: relative;
  min-width: 32px;
  max-width: 32px;
  line-height: 1em;
}
.inventory-flex {
  background-repeat: no-repeat;
  background-position: center;
  width: 32px;
  height: 100%;
  margin-bottom: -3px;
  margin-left: -3px;
}
.inventory-flex-container:hover .inventory-flex {
  position: absolute;
  height: 32px;
  z-index: 2;
  margin-top: -20px;
  right: 4px;
  box-shadow: 0 0 5px black;
  border-radius: 4px;
  padding: 4px;
}

.item-view {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--background-primary);
}
.item-view-header {
  display: flex;
}
.item-view .item-showcase {
  margin: 0 2px;
  min-width: 68px;
  max-width: 68px;
}
.item-view button.icon-back {
  width: 200px;
  margin-left: auto;
  margin-right: 22px;
  margin-bottom: 1px;
}

.item-view-content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}
.item-view .item-icon {
  min-width: 74px;
  max-width: 74px;
  height: 108px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 64px;
}
.item-view .item-icon.chart {
  cursor: pointer;
  border: solid 12px transparent;
  background: conic-gradient(var(--background-primary) 0, var(--background-primary) 0) padding-box,
  conic-gradient(
    var(--item-quality-stock) 0deg,
    var(--item-quality-stock) var(--progress-s),
    var(--item-quality-common) var(--progress-s),
    var(--item-quality-common) var(--progress-c),
    var(--item-quality-uncommon) var(--progress-c),
    var(--item-quality-uncommon) var(--progress-u),
    var(--item-quality-rare) var(--progress-u),
    var(--item-quality-rare) var(--progress-r),
    var(--item-quality-epic) var(--progress-r),
    var(--item-quality-epic) var(--progress-e),
    var(--item-quality-legendary) var(--progress-e),
    var(--item-quality-legendary) var(--progress-l),
    var(--item-quality-vintage) var(--progress-l),
    var(--item-quality-vintage) var(--progress-v),
    var(--item-quality-author), var(--progress-v),
    var(--item-quality-author), var(--progress-a),
    rgba(128, 128, 128, 0.5) var(--progress-a),
    rgba(128, 128, 128, 0.5) 360deg) border-box;
  border-radius: 50%;
  height: 42px;
  max-width: 42px;
  min-width: 42px;
  margin: 21px 4px;
  text-align: center;
  line-height: 42px;
  user-select: none;
}

.item-view .item-info {
  flex-grow: 420;
  flex-basis: 240px;
}
.item-view .item-id {
  font-size: 1.5em;
  white-space: nowrap;
  margin: 0 4px;
}
.item-view .item-group {
  font-size: 0.75em;
  opacity: 0.75;
  font-style: italic;
}
.item-view .item-qualities>* {
  margin-right: 4px;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 8px;
}
.item-view .item-stats,
.item-view .item-sort {
  margin-top: 4px;
}
.item-view .item-send-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.item-view .item-send-container>* {
  margin-right: 24px;
  margin-top: 1px;
}
.item-view .item-send-quantity {
  width: 3em !important;
}
.item-view .item-receivers {
  width: 8em !important;
}

.item-view .item-actions {
  flex-grow: 1;
  margin-left: auto;
  margin-right: 22px;
  margin-bottom: 10px;
  min-width: 200px;
  display: flex;
  flex-wrap: wrap;
}
.item-view .item-actions button {
  white-space: nowrap;
  flex: 1 1 150px;
  width: 0;
  margin: 1px;
  height: fit-content;
}

section[data-tab="inventory"] .fileish-container {
  overflow-x: unset;
}
.inventory-item {
  height: 4em;
  width: 4em;
  border-radius: 8px;
  cursor: pointer;
  margin: 2px;
  padding: 2px;
}
.inventory-item-display {
  min-height: 32px;
  min-width: 32px;
  background-repeat: no-repeat;
  background-position: center;
}
.inventory-item-index {
  display: inline-block;
  font-weight: bold;
}
.inventory-item-count {
  width: 100%;
  text-align: right;
  padding: 2px;
  margin: -4px;
}
.inventory-item-quality-badge {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  border: 1px solid black;
  float: right;
}
.inventory-item:hover .inventory-item-display {
  animation: mirror 1.5s infinite;
}
.inventory-item.selected .inventory-item-display {
  animation: mirror 0.75s infinite;
}
.quality-stock {
  background-color: var(--item-quality-stock) !important;
  color: black !important;
}
.quality-common {
  background-color: var(--item-quality-common) !important;
  color: black !important;
}
.quality-uncommon {
  background-color: var(--item-quality-uncommon) !important;
  color: black !important;
}
.quality-rare {
  background-color: var(--item-quality-rare) !important;
  color: black !important;
}
.quality-epic {
  background-color: var(--item-quality-epic) !important;
  color: black !important;
}
.quality-legendary {
  background-color: var(--item-quality-legendary) !important;
  color: black !important;
}
.quality-vintage {
  background-color: var(--item-quality-vintage) !important;
  color: black !important;
}
.quality-author {
  background-color: var(--item-quality-author) !important;
  color: black !important;
}

.icon-yoab {
  background-image: url('./base/icon32/yoab.png');
}
.icon-open {
  background-image: url('./base/icon32/open.png');
}
.icon-open.small {
  background-image: url('./base/icon16/open.png');
}
.icon-link {
  background-image: url('./base/icon32/link.png');
}
.icon-link.small {
  background-image: url('./base/icon16/link.png');
}
.icon-edit {
  background-image: url('./base/icon32/edit.png');
}
.icon-edit.small {
  background-image: url('./base/icon16/edit.png');
}
.icon-check {
  background-image: url('./base/icon32/check.png');
}
.icon-check.small {
  background-image: url('./base/icon16/check.png');
}
.icon-times {
  background-image: url('./base/icon32/times.png');
}
.icon-times.small {
  background-image: url('./base/icon16/times.png');
}
.icon-warn {
  background-image: url('./base/icon32/warn.png');
}
.icon-stencil-edit {
  background-image: url('./base/icon32/stencil_edit.png');
}
.icon-stencil-edit.small {
  background-image: url('./base/icon16/stencil_edit.png');
}
.icon-stencil-restore.small {
  background-image: url('./base/icon16/stencil_restore.png');
}
.icon-chat {
  background-image: url('./base/icon32/chat.png');
}
.icon-speaker {
  background-image: url('./base/icon32/speaker.png');
}
.icon-speaker.small {
  background-image: url('./base/icon16/speaker.png');
}
.icon-speaker-mute {
  background-image: url('./base/icon32/speaker_mute.png');
}
.icon-speaker-mute.small {
  background-image: url('./base/icon16/speaker_mute.png');
}
.icon-scope-device.small {
  background-image: url('./base/icon16/scope_device.png');
}
.icon-scope-profile.small {
  background-image: url('./base/icon16/scope_profile.png');
}
.icon-mode-dark {
  background-image: url('./base/icon32/mode_dark.png');
}
.icon-mode-light {
  background-image: url('./base/icon32/mode_light.png');
}
.icon-notif {
  background-image: url('./base/icon32/notif.png');
}
.icon-notif.small {
  background-image: url('./base/icon16/notif.png');
}
.icon-notif-off {
  background-image: url('./base/icon32/notif_off.png');
}
.icon-notif-off.small {
  background-image: url('./base/icon16/notif_off.png');
}
.icon-undo {
  background-image: url('./base/icon32/undo.png');
}
.icon-cancel {
  background-image: url('./base/icon32/cancel.png');
}
.icon-overlay-none {
  background-image: url('./base/icon32/overlay_none.png');
}
.icon-heatmap {
  background-image: url('./base/icon32/heatmap.png');
}
.icon-usermap {
  background-image: url('./base/icon32/usermap.png');
}
.icon-overlay-clear {
  background-image: url('./base/icon32/overlay_clear.png');
}
.icon-stencil {
  background-image: url('./base/icon32/stencil.png');
}
.icon-overlay-mode {
  background-image: url('./base/icon32/overlay_mode.png');
}
.icon-flip-h {
  background-image: url('./base/icon32/flip_h.png');
}
.icon-flip-h.small {
  background-image: url('./base/icon16/flip_h.png');
}
.icon-left {
  background-image: url('./base/left.png');
}
.icon-right {
  background-image: url('./base/right.png');
}
.icon-clock {
  background-image: url('./base/icon32/clock.png');
}
.icon-pixel {
  background-image: url('./base/icon32/pixel.png');
}
.icon-line {
  background-image: url('./base/icon32/line.png');
}
.icon-bucket {
  background-image: url('./base/icon32/bucket.png');
}
.icon-rect {
  background-image: url('./base/icon32/rect.png');
}
.icon-pencil {
  background-image: url('./base/icon32/pencil.png');
}
.icon-valentine {
  background-image: url('./base/icon32/valentine.png');
}
.icon-amogus {
  background-image: url('./../res/emoji/amogus.png');
}
.icon-eyedropper {
  background-image: url('./base/icon32/eyedropper.png');
}
.icon-polyline {
  background-image: url('./base/icon32/polyline.png');
}
.icon-linedot {
  background-image: url('./base/icon32/linedot.png');
}
.icon-max-radius {
  background-image: url('./base/icon32/max_radius.png');
}
.icon-border-ignore {
  background-image: url('./base/icon32/border_ignore.png');
}
.icon-stencil-ignore {
  background-image: url('./base/icon32/stencil_ignore.png');
}
.icon-blend-pixel {
  background-image: url('./base/icon32/blend_pixel.png');
}
.icon-coarse {
  background-image: url('./base/icon32/coarse.png');
}
.icon-upscale {
  background-image: url('./base/icon32/upscale.png');
}
.icon-upscale.small {
  background-image: url('./base/icon16/upscale.png');
}
.icon-copy-image {
  background-image: url('./base/icon32/copy_image.png');
}
.icon-copy-image.small {
  background-image: url('./base/icon16/copy_image.png');
}
.icon-frowney.small {
  background-image: url('./base/icon16/frowney.png');
}
.icon-remove-bg.small {
  background-image: url('./base/icon16/remove_bg.png');
}
.icon-overlay-minus {
  background-image: url('./base/icon32/overlay_minus.png');
}
.icon-overlay-plus {
  background-image: url('./base/icon32/overlay_plus.png');
}
.icon-paste.small {
  background-image: url('./base/icon16/paste.png');
}
.icon-copy {
  background-image: url('./base/icon32/copy.png');
}
.icon-snapshot {
  background-image: url('./base/icon32/snapshot.png');
}
.icon-snapshot.small {
  background-image: url('./base/icon16/snapshot.png');
}
.icon-snap {
  background-image: url('./base/icon32/snapshot_area.png');
}
.icon-selection-rect {
  background-image: url('./base/icon32/selection_rect.png');
}
.icon-grid {
  background-image: url('./base/icon32/grid.png');
}
.icon-guidelines {
  background-image: url('./base/icon32/guidelines.png');
}
.icon-move-locked {
  background-image: url('./base/icon32/move_locked.png');
}
.icon-move-unlocked {
  background-image: url('./base/icon32/move_unlocked.png');
}
.icon-dropdown {
  background-image: url('./base/icon32/dropdown.png');
}
.icon-uproll.small{
  background-image: url('./base/icon16/uproll.png');
}
.icon-downroll.small{
  background-image: url('./base/icon16/downroll.png');
}
.icon-star.small{
  background-image: url('./base/icon16/star.png');
}
.icon-star-off.small{
  background-image: url('./base/icon16/star_off.png');
}
.icon-back.small{
  background-image: url('./base/icon16/back.png');
}
.icon-envelope.small{
  background-image: url('./base/icon16/envelope.png');
}
.icon-auth {
  background-image: url('./base/icon32/auth.png');
}
.icon-auth.small {
  background-image: url('./base/icon16/auth.png');
}
.icon-profile {
  background-image: url('./base/icon32/profile.png');
}
.icon-archive {
  background-image: url('./base/icon32/archive.png');
}
.icon-users {
  background-image: url('./base/icon32/users.png');
}
.icon-stencil-big {
  background-image: url('./base/icon32/stencil_big.png');
}
.icon-help {
  background-image: url('./base/icon32/help.png');
}
.icon-media {
  background-image: url('./base/icon32/media.png');
}
.icon-lang {
  background-image: url('./base/icon32/lang.png');
}
.icon-location {
  background-image: url('./base/icon32/location.png');
}
.icon-location-off {
  background-image: url('./base/icon32/location_off.png');
}
.icon-scrollable {
  background-image: url('./base/scrollable.png');
}
.icon-groupable {
  background-image: url('./base/groupable.png');
}
.icon-stackable {
  background-image: url('./base/stackable.png');
}
.mono {
  font-family: 'Vincent Praise Monospace', 'Vincent Praise', 'Unifont';
}
.flex {
  display: flex !important;
  align-items: center;
}
/* Compact toolbar item selection breakpoint */
@media only screen and (max-width: 1200px) {
  #controls span.absolute-hack {
    display: inline-block;
  }  
  body:not(.archive-mode) #controls .compact-hidden {
    display: none;
  }
  body:not(.archive-mode) .toolbar-compact-selection {
    position: absolute;
    top: 0;
    flex-direction: column;
    background-color: var(--background-primary);
    border-radius: 4px;
  }
  #tools-group-selection {
    right: 0;
  }
  #overlay-selection {
    left: 0;
  }
}
@media only screen and (max-width: 720px) {
  #top-menu>:not(#auth)>span:not(.indicator):not(.no-hide) {
    display: none;
  }
  #top-menu>#chat {
    background-position: center center;
  }
  #status-bar {
    height: 40px;
  }
  #swatch-controls {
    flex-basis: 72px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }
  #swatch-foreground, #swatch-background {
    font-size: 0;
    width: 24px;
  }
  #coords {
    flex-basis: 80px;
    flex-shrink: 0;
  }
  #controls-expand {
    display: block;
  }
  #controls-misc:not(.visible) {
    display: none;
  }
  .control-bar button.iconed {
    width: 24px;
    color: transparent;
    padding: 4px 2px;
    margin: 4px;
  }
}
@media only screen and (max-width: 720px), screen and (max-height: 720px) {
  :not(#chat-container) .badge {
    width: 16px;
    height: 16px;
    margin: -3px 0;
  }
  #top-menu {
    padding: 2px 8px 2px 4px;
    border-bottom-right-radius: 4px;
    margin-right: -4px;
  }
  #top-menu>*, #controls span {
    font-size: 1em;
  }
  #top-menu>* {
    border-radius: 2px;
    text-shadow: 0 1px var(--text-shadow);
    min-height: 28px;
    padding: 2px 2px 2px 34px;
    background-position: 2px 50%;
    margin: 0;
  }
  #cooldown, #event-message {
    height: 28px;
    background-size: 24px;
    font-size: 1.5em;
    line-height: 1.25em;
  }
  #cooldown {
    width: 80px;
  }
  #top-menu>*>span:not(.indicator) {
    padding: 5px 2px;
  }
  #top-menu>#stats {
    white-space: normal;
  }
  #top-menu>#stats>span.indicator {
    display: block;
    width: 24px;
    border-radius: 16px;
    font-size: 0.75em;
  }
  #online {
    margin: 0 0 2px;
  }
  #idle {
    margin: 2px 0 0;
  }
  #controls {
    padding: 2px;
  }
  #controls > div {
    margin: 2px 4px;
  }
  #controls span {
    width: 28px;
    height: 28px;
    margin: 2px;
    background-size: 24px;
  }
  .modal {
    max-width: unset;
    width: 100% !important;
    height: 100%;
    max-height: 100%;
    top: 0;
    padding: 0;
    border-radius: 0;
  }
  .modal>main {
    height: 0; /* VERY obvious height fix! */
    flex-grow: 1;
    border-radius: 0;
    max-height: unset;
  }
  .modal .maximize {
    display: none;
  }  
  #stats-modal td {
    height: 18px;
  }
  #chat-emoji-toggle {
    right: 40px;
    top: 6px;
  }
  #chat-message-input {
    height: 4em;
    padding-right: 80px;
  }
  ul#chat-suggestions {    
    margin: 0 0 4.2em;
  }
  #controls span.icon-pixel {
    font-size: 0.8em;
    padding: 1px 2px;
  }
}

.cursor-pointer {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.hidden-v {
  visibility: hidden !important;
}

.archive-mode-visible {
  display: none;
}
body.archive-mode .archive-mode-hidden {
  display: none !important;
}
body.archive-mode .archive-mode-visible {
  display: block;
}
