* {
  margin: 0;
  padding: 0;
}

body{
	display: flex;
    flex-direction: column;
	background-color: #EBEBEB;
	height: 100vh;
	overflow: hidden;
}
@font-face {
  font-family: 'customfont';
  src: url('font/customfont.eot?12920904');
  src: url('font/customfont.eot?12920904#iefix') format('embedded-opentype'),
	   url('font/customfont.woff2?12920904') format('woff2'),
	   url('font/customfont.woff?12920904') format('woff'),
	   url('font/customfont.ttf?12920904') format('truetype'),
	   url('font/customfont.svg?12920904#customfont') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
    font-family: 'PressStart2P';
    src: url('font/PressStart2P-Regular.woff2') format('woff2'),
		 url('font/PressStart2P-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
  }
[class^="icon-"]:before, [class*=" icon-"]:before {
  font-family: "customfont";
  font-style: normal;
  font-weight: normal;
  speak: never;
  display: inline-block;
  text-decoration: inherit;
  width: 1em;
  margin-right: .2em;
  text-align: center;
  font-variant: normal;
  text-transform: none;
  line-height: 1em;
  margin-left: .2em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.icon-reply:before { content: '\e800'; } /* '' */
.icon-forward:before { content: '\e801'; } /* '' */
.icon-folder:before { content: '\e802'; } /* '' */
.icon-picture:before { content: '\e803'; } /* '' */
.icon-up-hand:before { content: '\e804'; } /* '' */
.icon-down-hand:before { content: '\e805'; } /* '' */
.icon-left-hand:before { content: '\e806'; } /* '' */
.icon-info-circled:before { content: '\e807'; } /* '' */
.icon-download:before { content: '\e808'; } /* '' */
.icon-upload:before { content: '\e809'; } /* '' */
.icon-brush-1:before { content: '\e80a'; } /* '' */
.icon-right-hand:before { content: '\e80b'; } /* '' */
.icon-resize-full:before { content: '\e80c'; } /* '' */
.icon-resize-full-alt:before { content: '\e80d'; } /* '' */
.icon-resize-small:before { content: '\e80e'; } /* '' */
.icon-resize-small-alt:before { content: '\e80f'; } /* '' */
.icon-cursor:before { content: '\e810'; } /* '' */
.icon-plus:before { content: '\e811'; } /* '' */
.icon-minus:before { content: '\e812'; } /* '' */
.icon-tint:before { content: '\e813'; } /* '' */
.icon-github:before { content: '\e814'; } /* '' */
.icon-cog:before { content: '\e817'; } /* '' */
.icon-pencil:before { content: '\e818'; } /* '' */
.icon-music:before { content: '\e819'; } /* '' */
.icon-zoom-in:before { content: '\e81a'; } /* '' */
.icon-zoom-out:before { content: '\e81b'; } /* '' */
.icon-fast-backward:before { content: '\e81c'; } /* '' */
.icon-fast-forward:before { content: '\e81d'; } /* '' */
.icon-forward-1:before { content: '\e81e'; } /* '' */
.icon-backward:before { content: '\e81f'; } /* '' */
.icon-pause-circled:before { content: '\e820'; } /* '' */
.icon-pause-1:before { content: '\e821'; } /* '' */
.icon-cw:before { content: '\e822'; } /* '' */
.icon-cancel-circled:before { content: '\e823'; } /* '' */
.icon-cancel-circled2:before { content: '\e824'; } /* '' */
.icon-search:before { content: '\e825'; } /* '' */
.icon-cancel-2:before { content: '\e826'; } /* '' */
.icon-help-circled:before { content: '\e827'; } /* '' */
.icon-info-circled-1:before { content: '\e828'; } /* '' */
.icon-trash:before { content: '\e83d'; } /* '' */

.tabs{
	display: flex;
    flex-direction: column;
	flex-grow: 1;
}

.tabs__content{
	display: flex;
    flex-direction: column;
	flex-grow: 1;
}

.tabs__nav {
  display: flex;
  gap: 5px;
}

.tabs__btn {
  padding: 10px 20px;
  background: #eee;
  border: none;
  cursor: pointer;
  border-radius: 5px 5px 0 0;
}

.tabs__btn.active {
  background: #ddd;
  font-weight: bold;
}

.tabs__item {
  display: none;
  flex-wrap: wrap;
  align-content: center;
  flex-direction: column;
  padding: 20px;
  background: #ddd;
  border-radius: 0 5px 5px 5px;
  background: white;
}

.tabs__item.active {
	display: flex;
	flex-grow: 1;
	flex-direction: column;
	flex-wrap: nowrap;
}

.blockly-minimap {
	position: absolute;
	top: 120px;
	right: 20px;
	opacity: 0.7;
	width: 150px;
	height: 50%;
	background: #fff;
}

.blockly-minimap:hover {
	opacity: 1;
}

.js-keyword { color: #0077aa; font-weight: bold; }
.js-string { color: #669900; }
.js-number { color: #990055; }
.js-comment { color: #999999; font-style: italic; }
.js-operator { color: #555555; }
#codeOutput {
	font-family: monospace;
	white-space: pre;
	background: #f5f5f5;
	padding: 10px;
	border-radius: 5px;
}

#gameFlags{
    display: flex;
}

#screen-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: calc(100vh - 150px); /* Учитываем высоту других элементов */
    overflow: hidden;
    position: relative;
	transition: all 1s ease-out;
}

#objectsList {
    width: 25%;
    max-height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease; /* Анимация для плавного скрытия/показа */
}

#debug{
	display: inline-block;
    position: fixed;
    left: 0;
    top: 150px;
    z-index: 9999;
    background: #eee;
    opacity: 0.8;
}

.debug-object-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 8px !important; /* Важно сохранить горизонтальные отступы */
    transition: all 0.3s ease;
}

.debug-object-details.expanded {
    max-height: 1000px; /* Достаточно большое значение для вмещения контента */
    opacity: 1;
    padding: 8px !important;
}

.debug-vars-details {
	display: none;
	padding: 8px;
	background: #2a2a2a;
	border: 1px solid #444;
	margin-bottom: 12px;
	max-height: 400px;
	overflow-y: auto;
}
.debug-vars-details.expanded {
	display: block;
}

#cnv {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transition: all 0.3s ease; /* Анимация для плавного смещения */
    margin-right: auto;
	margin-left: auto;
}

/* Если objectsList скрыт, canvas центрируется */
#objectsList[style*="display: none"] + #cnv {
    margin-left: auto;
    margin-right: auto;
}

#blocklyDiv{
	width: 100%;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
}

#icon {
	width: 80px;
    height: 80px;
    position: fixed;
    right: 2px;
	top: 2px;
	border: 4px solid #FFF;
	border-radius: 1px;
	cursor: pointer;
	transition: all 0.3s ease;
}

#icoFileInput{
	display: none;
}

#codeOutput {
	width: 95vw;
    height: 80vh;
	border: 1px solid #ccc;
	padding: 10px;
	margin-top: 10px;
	background: #f5f5f5;
	overflow: auto;
}

button,input {
	padding: 8px 10px;
	font-size: 18px;
	background-color: #EBEBEB;
	border: 2px solid #FFF;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	color: #3250ec;
	font-weight: bold;
	outline: none;
	user-select: none;
	display: inline-block;
}

button:hover,#icon:hover {
	animation: borderColors 1s infinite linear;
}

input:hover {
	animation: borderColors 1s infinite linear;
	background-color: #FFF;
}

@keyframes borderColors {
	0% { border-color: #3FE9D3; }
	50% { border-color: #04B9C3; }
	100% { border-color: #3FE9D3; }
}

/* Базовый стиль для чекбоксов */
.checkbox-container {
  display: inline-flex;
  align-items: center;
  color: #3250ec;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  cursor: pointer;
  padding: 6px 10px;
  border: 2px solid #FFF;
  border-radius: 4px;
  background-color: #EBEBEB;
  transition: all 0.2s ease;
}

.checkbox-container:hover {
  animation: borderColors 1s infinite linear;
}

/* Скрываем нативный чекбокс */
.checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}

/* Кастомный чекбокс */
.checkbox-custom {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  background-color: hsl(220, 15%, 30%);
  border-radius: 4px;
  border: 2px solid hsl(220, 15%, 40%);
  transition: all 0.2s ease;
}

/* Галочка (скрыта по умолчанию) */
.checkbox-custom::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Активное состояние */
.checkbox-container input[type="checkbox"]:checked ~ .checkbox-custom {
  background-color: hsl(217, 89%, 61%);
  border-color: hsl(217, 89%, 61%);
}

.checkbox-container input[type="checkbox"]:checked ~ .checkbox-custom::after {
  display: block;
}

.checkbox-container input[type="checkbox"] ~ label {
  text-decoration: line-through;
}

.checkbox-container input[type="checkbox"]:checked ~ label {
  text-decoration: none;
}

/* Состояние фокуса */
.checkbox-container input[type="checkbox"]:focus ~ .checkbox-custom {
  box-shadow: 0 0 0 3px hsla(217, 89%, 61%, 0.3);
  border-color: hsl(217, 89%, 61%);
}

/* Отключенное состояние */
.checkbox-container input[type="checkbox"]:disabled ~ .checkbox-custom {
  opacity: 0.5;
  background-color: hsl(220, 15%, 25%);
}

.checkbox-container input[type="checkbox"]:disabled ~ label {

}

.dropdown {
	position: relative;
	display: inline-block;
	margin-right: 10px;
	margin-bottom: 10px;
}

.dropdown-btn {
	padding: 8px 16px;
	font-size: 18px;
	background-color: #EBEBEB;
	border: 2px solid #FFF;
	border-radius: 1px;
	cursor: pointer;
	transition: all 0.3s ease;
	color: #3250ec;
	font-weight: bold;
	outline: none;
	min-width: 140px;
	text-align: left;
	position: relative;
}

.dropdown-btn:after {
	content: "▼";
	font-size: 12px;
	position: absolute;
	right: 3px;
	top: 50%;
	transform: translateY(-50%);
}

.dropdown-content {
	display: none;
	position: absolute;
	background-color: #f9f9f9;
	width: 180px;
	box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
	z-index: 99;
	border: 4px solid #FFF;
}

.dropdown-hlp{
	padding: 16px 0 16px 0;
}

.dropdown-content button, .dropdown-content input, .dropdown-hlp {
	display: inline-block;
	width: 100%;
	text-align: left;
	border: none;
	background-color: #EBEBEB;
	font-size: 16px;
	color: #3250ec;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
}

.dropdown-content button:hover, .dropdown-content input:hover, .dropdown-hlp:hover {
	background-color: #ddd;
	animation: borderColors 1s infinite linear;
}

.dropdown:hover .dropdown-content {
	display: block;
}

.loader-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	font-family: Arial, sans-serif;
}

.progress-container {
	width: 80%;
	max-width: 500px;
	margin: 20px 0;
}

.progress-bar {
	width: 100%;
	height: 20px;
	background: #e0e0e0;
	border-radius: 10px;
	overflow: hidden;
}

.progress {
	height: 100%;
	background: linear-gradient(to right, #4CAF50, #8BC34A);
	width: 0%;
	transition: width 0.3s ease;
}

.status {
	margin-top: 15px;
	text-align: center;
	line-height: 1.5;
}

.library-info {
	font-size: 0.9em;
	color: #555;
	margin-top: 5px;
}

.blocklyDropdownText {
    font-size: 13pt !important;
}

.switch-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1001;
	justify-content: center;
	align-items: center;
}

.switch-modal-content {
	background-color: white;
	width: 90%;
	max-width: 440px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	border: 2px solid #3FE9D3;
	position: absolute;
	transition: transform 0.2s ease-out, top 0.2s ease-out, left 0.2s ease-out;
}

.switch-modal-header {
	background-color: #EEE;
	color: #3250ec;
	padding: 15px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: move;
}

.switch-modal-title {
	font-weight: bold;
	font-size: 18px;
	pointer-events: none;
}

.switch-modal-close {
	font-size: 24px;
	cursor: pointer;
	transition: transform 0.2s;
	pointer-events: auto;
}

.switch-modal-close:hover {
	transform: scale(1.2);
}

.switch-modal-body {
	padding: 20px;
	padding-bottom: 0;
}

.switch-modal-buttons {
	display: flex;
	justify-content: flex-end;
	margin-top: 20px;
}

#settingsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.settings-modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 2px solid #3FE9D3;
    position: relative;
    transition: transform 0.2s ease-out, top 0.2s ease-out, left 0.2s ease-out;
    overflow-y: auto;
}

.settings-modal-show {
    animation: fadeIn 0.3s forwards;
}

.settings-modal-hide {
    animation: fadeOut 0.3s forwards;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(-20px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(-20px); }
}

.modal-show {
	animation: fadeIn 0.3s forwards;
}

.modal-hide {
	animation: fadeOut 0.3s forwards;
}

.form-group {
	margin-bottom: 15px;
}

.switch-input {
	width: 100%;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #fff;
}

.icon-container {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 5px;
}

.icon-preview {
	width: 64px;
	height: 64px;
	border-radius: 4px;
	background-color: #f5f5f5;
	object-fit: contain;
	border: 1px solid #ddd;
}

.switch-checkbox {
	display: flex;
	align-items: center;
	cursor: pointer;
}

.switch-checkbox input {
	display: none;
}

.switch-checkbox-custom {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 1px solid #ccc;
	border-radius: 3px;
	margin-right: 8px;
	position: relative;
}

.switch-checkbox input:checked + .switch-checkbox-custom {
	background-color: #4285f4;
	border-color: #4285f4;
}

.switch-checkbox input:checked + .switch-checkbox-custom::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.switch-modal-footer {
	padding: 15px;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.settings-section {
    margin-bottom: 20px;
}

.scroll-container {
    max-height: 140px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 10px;
	scrollbar-width: thin;
}

.btn-reset {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: auto; /* Размещает слева */
}

.btn-reset:hover {
    background-color: #ff5252;
}

.key-mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.key-mapping-table th, 
.key-mapping-table td {
    padding: 8px 12px;
    border: 1px solid #444;
    text-align: left;
}

.key-mapping-table input {
    width: 100%;
    padding: 4px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 3px;
}

.hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}