@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --bg-accent: #e2d5c2;
  --panel: #ffffff;
  --panel-border: #e0d7c9;
  --ink: #2b2b2b;
  --muted: #6e655a;
  --accent: #c45b2d;
  --accent-dark: #9e461f;
  --shadow: rgba(44, 32, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 45%),
    radial-gradient(circle at bottom right, rgba(196, 91, 45, 0.15), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 40px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title-main {
  font-size: 28px;
  font-weight: 600;
}

.title-sub {
  font-size: 14px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  min-width: 220px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: "Space Grotesk", sans-serif;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 1px 2px var(--shadow);
}

button {
  border: none;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
}

.run {
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(196, 91, 45, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.run:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(196, 91, 45, 0.28);
}

.run:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(196, 91, 45, 0.2);
}

.ghost {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 10px;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 16px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 30px rgba(59, 42, 25, 0.08);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.hint {
  color: var(--accent-dark);
  font-size: 12px;
  text-transform: none;
}

#codeEditor {
  display: none;
}

.CodeMirror {
  flex: 1;
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 14px;
  line-height: 1.6;
  background: #fbfaf8;
  color: #26231f;
  box-shadow: inset 0 0 0 1px rgba(196, 91, 45, 0.05);
}

.CodeMirror-focused {
  border-color: rgba(196, 91, 45, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 91, 45, 0.15);
}

#output {
  flex: 1;
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #1f1c18;
  color: #f4f1ec;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .toolbar {
    align-items: flex-start;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  select {
    min-width: 180px;
  }
}
