:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e9eef7;
  --muted: #E5E5E5;
  --line: #2A3140;
  --accent: #7db4ff;
  --fz-logo: 24px;
  --fz-contact: 16px;
  --pl-grid: 30% 37% 33%;
  --h-gap: 30px;
  --cntGap: 26px;
}

@media screen and (max-width:800px) {
  :root{
    --pl-grid: 50% 50%;
  }
}
@media screen and (max-width:700px) {
  :root{
    --fz-logo: 18px;
    --fz-contact: 14px;
    --h-gap: 10px;
    --cntGap: 5px;
  }
}
@media screen and (max-width:500px) {
  :root {
    --pl-grid: 100%;
  }
  .controls .checkbox, .controls .status{
    width: 100%;
  }
}
@media screen and (max-width:400px) {
  :root{
    --fz-logo: 16px;
  }
  .contact-item.vk{
    font-size: var(--fz-contact);
    a{
      display: flex;
      align-items: center;
      gap: 7px;
    }
    img{
      width: 25px;
    }
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: #0E1117;
  color: var(--text);
  min-height: 100vh;
}
.app {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 21px;
  padding: 0 15px 21px;
}
.header{
  display: grid;
  grid-template-columns : repeat(2,1fr);
  gap: var(--h-gap);
  align-items: center;
  padding-top: 21px;
}
.contact-item.mail{
    font-size: var(--fz-contact);
    font-weight: 500;
}
.contact-item a{
    color: #fff;
    text-decoration: none;
}
.contact-item a:hover{
    text-decoration: underline;
}
.logo{
    font-size: var(--fz-logo);
    font-weight: 500;
    color: #fff;
}
.header .col-right{
    text-align: right;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: var(--cntGap);
}
.panel {
  background: #161920;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  justify-content: space-between;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
button{
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn,
.ghost-button {
  appearance: none;
  border: 1px solid #2A3140;
  background: #202633;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.btn:hover,
.ghost-button:hover {
  background: #263043;
  border-color: #4a5874;
}
.btn:active,
.ghost-button:active {
  transform: translateY(1px);
}
.status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.presets-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.preset-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(125, 180, 255, 0.35) inset;
}
.keyboard-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
  position: relative;
}
.keyboard {
  position: relative;
  width: 720px;
  height: 480px;
  margin: 0 auto;
  background: #ffffff;
  border: 3px solid #000;
  user-select: none;
  touch-action: none;
}
 .preloader_sound.active{
  opacity: 0;
  visibility: hidden;
 }
.preloader_sound{
  position: absolute;
  transition: all 0.3s ease;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  z-index: 25;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 20px;
  color: #000;
  opacity: 1;
  visibility: visible;
}
.keyboard-wrap:hover .no_sound:not(.active){
  opacity: 1;
  visibility: visible;
}
.no_sound.active{
  opacity: 0;
  visibility: hidden;
}
.key {
  position: absolute;
  border: 3px solid #000;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: filter 0.06s ease, transform 0.06s ease, box-shadow 0.06s ease;
  outline: none;
}
.key:after{
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.color-red-2.active:after,
.color-red.active:after,
.color-green.active:after,
.color-dblue.active:after,
.color-blue.active:after{
  background: url('../image/sf.svg')no-repeat center;
  background-size: 26px;
}
.color-yellow.active:after,
.color-lime.active:after,
.color-white.active:after,
.color-cyan.active:after{
  background: url('../image/s.svg')no-repeat center;
  background-size: 26px;
}
.key:hover {
  filter: brightness(0.9);
}
.key.active {
  /*transform: translateY(1px);*/
  filter: brightness(0.9);
  /*box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.08);*/
}
.key .label {
  /*position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;*/
  display: none;
}
.color-red { background: #F40000; }
.color-red-2 { background: #9C0001; }
.color-blue { background: #3C01FD; }
.color-lime { background: #EBFF81; }
.color-cyan { background: #4CFFAB; }
.color-white { background: #F0F0F0; }
.color-yellow { background: #C6D820; }
.color-dblue { background: #17006A; }
.color-green { background: #1F7840; }
.panel.legend {
  display: grid;
  grid-template-columns: var(--pl-grid);
  gap: var(--h-gap);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.panel.legend code {
  color: #dfe7ff;
  background: #202633;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #313b4f;
}
#keyboard,
.key {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
#keyboard .label {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}