/* WASM Playground — Ocean Blue theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0984E3;
  --primary-dim: rgba(9,132,227,0.12);
  --primary-glow: rgba(9,132,227,0.3);
  --secondary: #74B9FF;
  --accent: #E17055;
  --bg: #0D1B2A;
  --bg-card: #13253A;
  --bg-input: #0A1525;
  --bg-hover: #1B3350;
  --border: rgba(9,132,227,0.15);
  --border-focus: rgba(9,132,227,0.5);
  --text: #E6EDF3;
  --text-dim: #8B949E;
  --text-muted: #4B5563;
  --green: #00B894;
  --red: #E17055;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(9,132,227,0.05), transparent 50%); pointer-events: none; }

.header { border-bottom: 1px solid var(--border); background: rgba(19,37,58,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }
.header-actions { display: flex; gap: 6px; align-items: center; }

.example-select { padding: 5px 8px; font-family: var(--font); font-size: 0.78rem; color: var(--text-dim); background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; outline: none; cursor: pointer; }
.example-select:focus { border-color: var(--border-focus); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-family: var(--font); font-size: 0.8rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #066BB0); color: white; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: var(--primary-dim); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }

.main { max-width: 1100px; margin: 0 auto; padding: 20px; }
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: calc(100vh - 100px); }

.editor-panel, .output-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.code-editor { flex: 1; width: 100%; padding: 14px; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; color: var(--secondary); background: var(--bg-input); border: none; outline: none; resize: none; min-height: 300px; tab-size: 2; }

.sub-section { border-bottom: 1px solid var(--border); }
.sub-header { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 14px; }

.exports-list { padding: 8px 14px; font-family: var(--mono); font-size: 0.75rem; color: var(--green); min-height: 32px; }
.placeholder { color: var(--text-muted); font-family: var(--font); }
.export-item { margin-bottom: 2px; }

.call-row { display: flex; gap: 6px; padding: 0 14px 8px; align-items: center; }
.fn-field { padding: 4px 8px; font-family: var(--mono); font-size: 0.75rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; outline: none; }
.fn-field:focus { border-color: var(--border-focus); }
select.fn-field { min-width: 80px; cursor: pointer; }
input.fn-field { flex: 1; }
.call-result { padding: 4px 14px 8px; font-family: var(--mono); font-size: 0.78rem; color: var(--accent); min-height: 20px; }
.compile-time { font-size: 0.68rem; color: var(--text-muted); font-family: var(--mono); }

.console-output { flex: 1; padding: 10px 14px; font-family: var(--mono); font-size: 0.75rem; line-height: 1.6; color: var(--text-dim); overflow: auto; white-space: pre-wrap; background: var(--bg-input); margin: 0; min-height: 100px; }
.console-output .err { color: var(--red); }
.console-output .ok { color: var(--green); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) { .layout { grid-template-columns: 1fr; } }
