html{
  color-scheme: dark light;
}

:root {
  --bg-gradient-clr1: #f0a;
  --bg-gradient-clr2: #0ff;
  --bg-gradient-clr3: #a0f;

  --bg-color: #1a1a1e;

  --screen_opacity: 80%;
}

body{
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper{
  position: absolute;
  justify-content: center;
  margin: 20px auto;
  z-index: 1;
  user-select: none;
}




.history-item:first-child {
  color: #fff;
  background: linear-gradient(135deg, rgb(15 206 255 / 64%), rgb(255 0 162 / 33%));
}

.history-item {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px !important;
  border-radius: 15px !important;
  background-color: #1a1a1e70;
  user-select: text;
}

.history-scroll {
  flex-grow: 1;
  height: 100%;
  overflow-y: scroll;
  padding-top: 10px;
  scrollbar-width: none;

  mask-image: linear-gradient(
          to bottom,
          transparent 0%,
          black 20px,
          black calc(100% - 20px),
          transparent 100%
  );
}

.history-scroll::-webkit-scrollbar {
  display: none;
}

.history_panel{
  position: absolute;
  top: 30px;
  left: calc(100% + 10px);
  width: 320px;
  height: 670px;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}


.rutube_btn{
  width: 50px;
  height: 50px;
  padding: 10px;
  box-sizing: border-box;

  border: 2px solid #f06;
  background-image: url("../img/Rutube-logo.svg");
  background-size: 70%;
  background-position: 50%;
  background-repeat: no-repeat;
}

.rutube_btn:hover{
  box-shadow: 0 0 20px #f06, inset 0 0 10px #f06;
  background-color: #f063;
}


.ru_wiki_btn{
  width: 50px;
  height: 50px;
  padding: 10px;
  box-sizing: border-box;

  border: 2px solid #a0f;
  color: #a0f;

  background-image: url("../img/Ruwiki-logo.svg");
  background-size: 70%;
  background-position: 50%;
  background-repeat: no-repeat;
}

.ru_wiki_btn:hover{
  box-shadow: 0 0 20px #a0f, inset 0 0 10px #a0f;
  background-color: #a0f3;
}

.instruction_btn{
  width: 170px;
  height: 50px;
  /* padding: 10px 20px; */
  margin-bottom: 10px;

  border: 2px solid #0ff;
  color: #0ff;

}

.instruction_btn:hover{
  box-shadow: 0 0 20px #0ff, inset 0 0 10px #0ff;
  background-color: #0ff3;
}


.btn_glassy{
  margin: 0;

  font-family: "GOST_A", monospace;
  font-weight: bold;
  font-size: 20px;
  line-height: 1.5;
  cursor: pointer;

  background-color: #1a1a1e12;
  border-radius: 15px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  
  transition:
          background-size .1s ease,
          font-size .1s ease;
}

.btn_glassy:hover{
  color: #fff;
  border: 2px solid #fff;
  background-size: 80%;

  font-size: 25px;
  transition:
          background-size .1s ease,
          font-size .1s ease;
}

.buttons_panel{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.about_panel{
  position: absolute;
  display: flex;
  flex-direction: column; /* Располагаем элементы вертикально */
  justify-content: space-between;
  top: 30px;
  left: calc(-100% + 80px);
  width: 320px;
  height: 230px;
  padding: 20px;
  box-sizing: border-box; /* Чтобы padding не увеличивал размеры */
}

.text_glassy{
  overflow-y: auto; /* Добавляет прокрутку если текст не помещается */
  color: #0ff; /* Цвет текста для лучшей читаемости */
  font-family: "GOST_A", Courier, monospace;
  margin: 0;
  font-weight: bold;
  font-size: 20px;
  line-height: 1.5;
  scrollbar-width: none;
  white-space: pre-line;
}

.tips_text{
  height: 100%;
}

.tips_panel{
  position: absolute;
  top: 270px;
  left: -330px;
  width: 320px;
  height: 430px;
  padding: 20px 30px 20px 20px;
  box-sizing: border-box;
}



.stand{
  position: relative;
  width: 370px;
  height: 640px;
  padding: 30px 20px;
  z-index: 3;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}

.circuit_track {
  position: absolute;
  width: 300px;
  height: 200px;
  z-index: 2;
  scale: 30%;
  justify-content: center;
  opacity: 10%;
  transition: opacity .3s ease, filter .3s;
}

.track_red{
  filter: invert();
  opacity: 100%;
}

.track_upper{
  top: 247px;
  left: -140px;
  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%22300%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ELayer%201%3C%2Ftitle%3E%0A%20%20%3Cellipse%20fill%3D%22none%22%20stroke-width%3D%2213%22%20cx%3D%2222.50001%22%20cy%3D%2222.50001%22%20id%3D%22svg_7%22%20rx%3D%2216.00001%22%20ry%3D%2216.00001%22%20stroke%3D%22%2300ffff%22%2F%3E%0A%20%20%3Cline%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2241.07564%22%20y1%3D%2222.50001%22%20x2%3D%22100.02448%22%20y2%3D%2222.50001%22%20id%3D%22svg_8%22%20stroke%3D%22%2300ffff%22%2F%3E%0A%20%20%3Cline%20stroke%3D%22%2300ffff%22%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2292.79232%22%20y1%3D%22100%22%20x2%3D%22342.99642%22%20y2%3D%22100%22%20id%3D%22svg_12%22%2F%3E%0A%20%20%3Cline%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2294%22%20y1%3D%2228.04598%22%20x2%3D%2294%22%20y2%3D%22105.97798%22%20id%3D%22svg_14%22%20stroke%3D%22%2300ffff%22%2F%3E%0A%20%3C%2Fg%3E%0A%0A%3C%2Fsvg%3E');
}

.track_middle{
  top: 262px;
  left: -140px;
  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%22300%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ELayer%201%3C%2Ftitle%3E%0A%20%20%3Cellipse%20stroke%3D%22%2300ffff%22%20ry%3D%2216.00001%22%20rx%3D%2216.00001%22%20id%3D%22svg_7%22%20cy%3D%22100%22%20cx%3D%2222.50001%22%20stroke-width%3D%2213%22%20fill%3D%22none%22%2F%3E%0A%20%20%3Cline%20id%3D%22svg_12%22%20y2%3D%22100%22%20x2%3D%22342.99642%22%20y1%3D%22100%22%20x1%3D%2243.16268%22%20stroke-width%3D%2212%22%20fill%3D%22none%22%20stroke%3D%22%2300ffff%22%2F%3E%0A%20%3C%2Fg%3E%0A%0A%3C%2Fsvg%3E');
}

.track_lower{
  top: 276px;
  left: -140px;
  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%22300%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ELayer%201%3C%2Ftitle%3E%0A%20%20%3Cellipse%20fill%3D%22none%22%20stroke-width%3D%2213%22%20cx%3D%2222.50001%22%20cy%3D%22177.49999%22%20id%3D%22svg_7%22%20rx%3D%2216.00001%22%20ry%3D%2216.00001%22%20stroke%3D%22%2300ffff%22%2F%3E%0A%20%20%3Cline%20stroke%3D%22%2300ffff%22%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2242.32564%22%20y1%3D%22177.5%22%20x2%3D%2299.91855%22%20y2%3D%22177.5%22%20id%3D%22svg_8%22%2F%3E%0A%20%20%3Cline%20stroke%3D%22%2300ffff%22%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2292.79232%22%20y1%3D%22100%22%20x2%3D%22342.99642%22%20y2%3D%22100%22%20id%3D%22svg_12%22%2F%3E%0A%20%20%3Cline%20stroke%3D%22%2300ffff%22%20fill%3D%22none%22%20stroke-width%3D%2212%22%20x1%3D%2294%22%20y1%3D%22180.04534%22%20x2%3D%2294%22%20y2%3D%2293.97803%22%20id%3D%22svg_14%22%2F%3E%0A%20%3C%2Fg%3E%0A%0A%3C%2Fsvg%3E');
}

.calc{
  position: relative;
  width: 470px;
  height: 800px;
  background-image: url('../img/calc.png');
  background-repeat: no-repeat;
  background-position: center;
  scale: 80%;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.glassy{
  border-radius: 30px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  background: linear-gradient(135deg, rgb(15 206 255 / 10%), rgb(255 0 162 / 11%));
}

.flag-panel {
  position: absolute;
  top: 0;
  left: 100%;
  translate: -100% 0;
  display: flex;
  margin: 0px;
  justify-content: end;
  align-items: center;
  text-align: center;
}

.flag{
  /* color: #0000ff; */
  margin: 0px 0px 0px 19px;
  font-family: monospace;
  font-size: 19px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  user-select: none;
  visibility: hidden; /* По умолчанию выключено */
  opacity: var(--screen_opacity);
}

.stat-flag{
  margin-right: 22px;
}

.calc-screen{
  position: relative;
  top: 228px;
  right: 81px;
  height: 100px;
  user-select: none;
  opacity: var(--screen_opacity);
  /*color: #09f;*/
}

.display{
  position: absolute;
  top: 0;
  left: 100%;
  translate: -100% 19px;
  width: 100%; /* Ширина 100% от контейнера */
  height: 100%;
  font-family: "Electronica", Courier, monospace;
  letter-spacing: -12px;
  white-space: pre;
  font-size: 48px;
  text-align: right;
  /*user-select: text;*/
  transform: skew(-9deg);
}

.grad_switch {
  position: relative;
  top: 278px;
  left: 8px;
  background-image: url("../img/grad_switch.png");
  width: 16px;
  height: 107px;
  background-repeat: no-repeat;
  background-position: center;
}

.grad_switch:hover{
  filter: brightness(140%);
}

.calc-buttons-func{
  position: relative;
  top: 167px;
  left: 0;
  display: grid;
  grid-template-areas:
    "on-off C CK lg ln F";
  grid-column-gap: 22px;
  grid-row-gap: 34px;
  justify-items: center;
  margin: 8px 61px;
}

.calc-buttons-numbers{
  position: relative;
  top: 175px;
  left: 0;
  display: grid;
  grid-template-areas:
    "7 8 9 div mem-in";
  justify-items: center;
  margin: 31px 52px;
  grid-column-gap: 21px;
  grid-row-gap: 32px;
}

.btn {
  position: relative;
  padding: 20px 40px;
  /*filter: brightness(200%);*/
  font-size: 16px;
  font-family: monospace;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  background-repeat: no-repeat;
  background-position: center;
  text-align: center;
  box-shadow: 6px 6px 8px #000;
  transition:
          box-shadow 0.2s ease,
          transform 0.2s ease;
}

.btn:active, .btn.pressed{
  box-shadow: none;
  background-size: 95%;
  transform: scale(0.95);
}

.btn:hover{
  filter: brightness(120%);
}

.btn-small{
  padding: 11px 18px;
  border-radius: 7px;
  box-shadow: 4px 4px 8px #000;
}


.btn.bg-red {
  background-image: url('../img/btn-red.png');
}

.btn.bg-gray {
  background-image: url('../img/btn-gray.png');
}

.btn.bg-black {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #75807b;  /* Цвет текста */
  background-image: url('../img/btn-black.png');
  width: 40px;
  height: 25px;
  padding: 1px 2px;
}


body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: start;
  background: var(--bg-color);
}

.gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-width: 520px;
  height: 100%;
  min-height: 850px;
  pointer-events: none; /* Игнорируем события мыши */
}

.background-numbers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-width: 520px;
  height: 100%;
  min-height: 850px;
  font-family: "Electronica", Courier, monospace;
  font-size: 20px;
  line-height: 30px;
  user-select: none;
  color: transparent;
  background: linear-gradient(
          to right,
          var(--bg-gradient-clr1),
          var(--bg-gradient-clr2),
          var(--bg-gradient-clr3));
  -webkit-background-clip: text;
  white-space: pre;
  pointer-events: none;
  overflow: hidden;
  /*font-style: italic;*/
}

.disabled {
  pointer-events: none;
}

.text-fade-inout{
  animation: screen-blink-animation 0.2s 2 alternate;
}

@keyframes text-fade-inout-animation {
  0% {
    opacity: 100%;
  }
  100% {
    opacity: 0;
  }
}


.screen-blink{
  animation: screen-blink-animation 0.08s 2 alternate;
}

@keyframes screen-blink-animation {
  0% {
    opacity: var(--screen_opacity);
  }
  100% {
    opacity: 30%;
  }
}


.glow {
  animation: glow-animation 0.5s 2 alternate;
}

@keyframes glow-animation {
  0% {
    filter: drop-shadow(0 0px 0px rgba(255, 0, 0, 0));
    box-shadow: 4px 4px 8px #000;
  }
  100% {
    filter: drop-shadow(0 0px 20px rgba(255, 0, 0, 1)) drop-shadow(0 0px 20px rgba(255, 0, 0, 1))
    drop-shadow(0 0px 20px rgba(255, 0, 0, 1)) drop-shadow(0 0px 20px rgba(255, 0, 0, 1))
    brightness(200%);
    box-shadow: none;
  }
}