body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(88, 28, 135, 0.45), transparent 55%),
    radial-gradient(circle at bottom, rgba(8, 47, 73, 0.6), transparent 55%),
    #020617;
  color: #e5e7eb;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout {
  max-width: 1420px;
  width: 100%;
  padding: 70px 24px 32px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.header {
  margin-bottom: 4px;
  text-align: center;
}

.header_navigation{
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  position: absolute;
  top:0;
  left:0;
  width:100%;
  height:50px;
  z-index:100;

}

.header-title {
  font-size: 1.7rem;
  color: #f9fafb;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-subtitle {
  margin: 0;
  color: #9ca3af;
  font-size: 0.95rem;
}

.card {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(148, 163, 184, 0.08);
  padding: 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-sizing: border-box;
}

.controls-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: #f9fafb;
  font-weight: 600;
}

p {
  margin: 4px 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

code {
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.85rem;
}

button {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background-image: linear-gradient(135deg, #22c1c3, #4f46e5, #7c3aed);
  background-size: 200% 200%;
  color: #f9fafb;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(248, 250, 252, 0.08);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    background-position 0.3s ease-out;
}

button:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
  box-shadow:
    0 22px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(248, 250, 252, 0.14);
}

button:active {
  transform: translateY(1px);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(248, 250, 252, 0.08);
}

.editors-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.editor-card {
  flex: 1 1 320px;
  min-width: 0;
}

.subtitle {
  margin-bottom: 12px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.field-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.number-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  width: 150px;
}

.number-input {
  background: transparent;
  border-radius: 999px;
  border: none;
  color: #e5e7eb;
  padding: 7px 38px 7px 12px; 
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  /* убираем стандартные стрелки в большинстве браузеров */
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: textfield;
}

.number-input:focus {
  outline: none;
}

.number-input-wrapper:focus-within {
  border-color: #4f46e5;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.8),
    0 0 20px rgba(79, 70, 229, 0.5),
    inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* полностью скрываем нативные стрелки в WebKit */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-input-arrow {
  position: absolute;
  right: 4px;
  width: 22px;
  height: 14px;
  padding: 0;
  margin-right:4px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  box-shadow:none;
  justify-content: center;
  transition:
    background-color 0.12s ease-out,
    transform 0.08s ease-out;
}

.number-input-arrow--up {
  top: 3px;
}

.number-input-arrow--down {
  bottom: 2px;
}

.number-input-arrow::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  mask-size: 14px 14px;
  mask-repeat: no-repeat;
  mask-position: center;
  background-color: #9ca3af;
}

.number-input-arrow--up::before {
  mask-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12L10 7L15 12' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.number-input-arrow--down::before {
  mask-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8L10 13L15 8' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.number-input-arrow:hover {
  background-color: rgba(30, 64, 175, 0.4);
}

.number-input-arrow:active {
  transform: translateY(1px);
  background-color: rgba(30, 64, 175, 0.6);
}

.results {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.results-logs-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.results-card,
.logs-card {
  flex: 1 1 260px;
  min-width: 0;
}

.logs-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 6px;
}

.console-output {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(30, 64, 175, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  color: #e5e7eb;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  box-sizing: border-box;
}

.hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.select-input {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  color: #e5e7eb;
  padding: 7px 36px 7px 12px;
  font-size: 0.9rem;
  box-sizing: border-box;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  /* убираем стандартную стрелку */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* кастомная стрелка */
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%239CA3AF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

.select-input:hover{
   cursor:pointer;
}

.select-input:focus {
  cursor:pointer;
  border-color: #4f46e5;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.8),
    0 0 20px rgba(79, 70, 229, 0.5),
    inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* скрываем стрелку в старых версиях Edge/IE */
select.select-input::-ms-expand {
  display: none;
}

/* CodeMirror integration */
.CodeMirror {
  width: 100%;
  min-height: 230px;
  border-radius: 14px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-sizing: border-box;
  padding: 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.CodeMirror-focused {
  border-color: #4f46e5;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.8),
    0 0 25px rgba(79, 70, 229, 0.45),
    inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.CodeMirror-gutters {
  background: transparent;
  border-right: 1px solid rgba(30, 64, 175, 0.65);
}

.CodeMirror-linenumber {
  color: #6b7280;
}

.CodeMirror-cursor {
  border-left: 2px solid #e5e7eb;
}

.checkbox-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  font-size: 0.85rem;
  color: #e5e7eb;
}

.checkbox-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #4f46e5;
  cursor: pointer;
}

.checkbox-toggle span {
  cursor: pointer;
}

.lang-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  margin-right:24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  opacity:0.8;
  position: absolute;
  right:0

}

.lang-switcher__btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background-image: none;
  background-color: transparent;
  box-shadow: none;
}

.lang-switcher__btn--active {
  background-image: none;
  background-color: #4f46e5;
  box-shadow:
    0 0 0 1px rgba(248, 250, 252, 0.2),
    0 8px 20px rgba(15, 23, 42, 0.9);
}

@media (max-width: 768px) {
  body {
    align-items: flex-start;
  }
  .layout {
    padding: 70px 12px 24px;
  }
  .header {
    text-align: left;
  }

  /* мобильная версия header_navigation */
  .header_navigation {
    justify-content: space-between;
  }

  .header-title {
    font-size: 1.25rem;
    letter-spacing: 0.03em;
    text-align: left;
    margin-left: 12px;
  }

  .lang-switcher {
    position: static;
    margin-right: 0;
  }

  .card {
    padding: 16px 14px;
  }

  .controls-card {
    flex-direction: column;
    align-items: stretch;
  }

  .editors-row,
  .results-logs-row,
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .editor-card,
  .results-card,
  .logs-card {
    flex: 1 1 auto;
  }

  .field-group {
    width: 100%;
  }

  .select-input,
  .number-input-wrapper {
    width: 100%;
  }

  #run-benchmark {
    width: 100%;
    justify-content: center;
  }

  .console-output {
    max-height: 180px;
  }
}

/* Убираем clip-path у редактора в темах darker dracula neo */
.CodeMirror.cm-s-material-darker,
.CodeMirror.cm-s-dracula,
.CodeMirror.cm-s-neo,
.cm-s-material-darker.CodeMirror-wrap,
.cm-s-material-darker .CodeMirror-wrap {
  clip-path: none !important;
}


