body, html {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  font-family: 'JetBrains Mono', monospace;
  background-color: #041c24;
  color: #f6c762;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.header {
  background-color: #0a3542;
  padding: 12px;
  font-size: 24px;
  font-weight: bold;
  border-bottom: 2px solid #5de4ff;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo {
  height: 32px;
  width: auto;
}

.welcome-banner {
  text-align: center;
  padding: 8px;
  background-color: #1a4552;
  color: #5de4ff;
  font-size: 15px;
  border-bottom: 1px solid #5de4ff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.template-bar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #082b35;
  border-bottom: 1px solid rgba(93, 228, 255, 0.45);
  overflow-x: auto;
}

.template-bar button {
  margin-right: 0;
  white-space: nowrap;
}

.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.editor-section, .canvas-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.editor-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

#editor {
  flex-grow: 1;
  background: #0a3542;
  border: 1px solid #5de4ff;
  margin-bottom: 10px;
  min-height: 0;
}

.fallback-editor {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 12px;
  box-sizing: border-box;
  background: #0a3542;
  color: #f6c762;
  font: 14px 'JetBrains Mono', monospace;
  line-height: 1.5;
}

.buttons {
  margin-bottom: 10px;
}

button {
  background-color: #f6c762;
  color: #041c24;
  border: none;
  padding: 8px 14px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
}

.flat-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  color: currentColor;
  image-rendering: pixelated;
}

.icon-play {
  clip-path: polygon(25% 12%, 25% 88%, 82% 50%);
  background: currentColor;
}

.icon-run {
  background:
    linear-gradient(currentColor 0 0) 4px 4px / 8px 8px no-repeat,
    linear-gradient(currentColor 0 0) 2px 2px / 12px 12px no-repeat;
}

.icon-grid {
  background:
    linear-gradient(currentColor 0 0) 2px 2px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 9px 2px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 2px 9px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 9px 9px / 5px 5px no-repeat;
}

.icon-reset {
  border: 2px solid currentColor;
  border-right-color: transparent;
}

.icon-reset::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 0;
  width: 6px;
  height: 6px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.icon-clear::before,
.icon-clear::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  height: 2px;
  background: currentColor;
}

.icon-clear::before {
  top: 5px;
}

.icon-clear::after {
  top: 10px;
}

.icon-spark {
  color: #f6c762;
}

.icon-spark::before,
.icon-spark::after {
  content: '';
  position: absolute;
  background: currentColor;
}

.icon-spark::before {
  left: 7px;
  top: 1px;
  width: 2px;
  height: 14px;
}

.icon-spark::after {
  left: 1px;
  top: 7px;
  width: 14px;
  height: 2px;
}

.tutorial-console {
  background-color: #1a4552;
  color: #f6c762;
  padding: 8px;
  border: 1px dashed #f6c762;
  font-size: 14px;
  margin-bottom: 10px;
}

.error-console {
  background-color: #1a4552;
  color: #ff5d5d;
  padding: 8px;
  border: 1px dashed #ff5d5d;
  font-size: 14px;
  margin-bottom: 10px;
  min-height: 20px;
}

#console {
  background-color: #0a3542;
  color: #5de4ff;
  height: 100px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #5de4ff;
}

.canvas-section {
  justify-content: center;
  align-items: center;
  padding: 10px;
  background-color: #041c24;
  height: 100%;
  gap: 10px;
}

canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  background-color: #0a3542;
  border: 2px solid #5de4ff;
  image-rendering: pixelated;
}

.guide-panel {
  width: 100%;
  max-height: 150px;
  overflow: auto;
  background: #082b35;
  border: 1px solid rgba(93, 228, 255, 0.5);
  color: #cfe6ff;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.guide-panel h2 {
  margin: 0 0 8px;
  color: #f6c762;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.guide-panel p {
  margin: 0 0 6px;
}

footer {
  background-color: #0a3542;
  padding: 12px;
  text-align: center;
  border-top: 2px solid #5de4ff;
  flex-shrink: 0;
}

footer p {
  margin: 0;
  color: #5de4ff;
  font-size: 14px;
}

@media (max-width: 900px) {
  body,
  html {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .container {
    flex-direction: column;
    min-height: 900px;
  }

  .editor-section,
  .canvas-section {
    min-height: 440px;
  }
}
