/* RES-368: minimum-viable styling for the WASM playground page.
 * Two-column layout (editor / output) with a thin top bar.
 * No framework — plain CSS keeps the page deployable as static
 * assets with no build step beyond `wasm-pack`.
 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f7f7;
  color: #1a1a1a;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #d0d0d0;
  background: #ffffff;
  flex: 0 0 auto;
}

header h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}

.banner {
  font-size: 12px;
  background: #fff7d6;
  color: #6a4f00;
  border: 1px solid #e6cf66;
  padding: 2px 8px;
  border-radius: 4px;
}

nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

nav label {
  font-size: 13px;
  color: #555;
}

nav select,
nav button {
  font: inherit;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #c0c0c0;
  background: #fff;
  cursor: pointer;
}

nav select:focus,
nav button:focus {
  outline: 2px solid #4f8cff;
  outline-offset: 1px;
}

#run-btn {
  background: #2c7a2c;
  color: #fff;
  border-color: #2c7a2c;
}

#run-btn:hover {
  background: #246124;
}

#run-btn:disabled {
  background: #9ec19e;
  border-color: #9ec19e;
  cursor: wait;
}

.github-link {
  font-size: 13px;
  color: #4f8cff;
  text-decoration: none;
}

.github-link:hover {
  text-decoration: underline;
}

main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: #d0d0d0;
  min-height: 0;
}

.editor-pane,
.output-pane {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.CodeMirror {
  flex: 1 1 auto;
  height: auto;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 13px;
}

#output {
  flex: 1 1 auto;
  margin: 0;
  padding: 12px 16px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow: auto;
  background: #fafafa;
}

#output.error {
  background: #fff0f0;
  color: #8a1a1a;
}

#output-footer {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  color: #777;
  background: #fff;
}

@media (max-width: 800px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  main > :nth-child(2) {
    order: -1;
  }

  .output-pane {
    min-height: 200px;
    max-height: 50vh;
    border-bottom: 1px solid #d0d0d0;
  }

  .editor-pane {
    flex: 1 1 auto;
  }
}
