/*
 * Playground pages (C, Python, SQL, HTML). These run inside an iframe, so they cannot read the site's CSS variables:
 * the Bilingual Workbench tokens are repeated here. Keep the values in step with app/globals.css.
 * Teal is the single action (Run), blue marks selection and focus, syntax uses the brand theme.
 */
@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/tools-static/lib/fonts/mona-sans-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/tools-static/lib/fonts/jetbrains-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 400; font-display: swap; size-adjust: 106%; src: url(/tools-static/lib/fonts/hind-siliguri-bengali-400.woff2) format("woff2"); unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 600 700; font-display: swap; size-adjust: 106%; src: url(/tools-static/lib/fonts/hind-siliguri-bengali-600.woff2) format("woff2"); unicode-range: U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }

:root {
  --sunken: #0e161e; --canvas: #121b24; --panel: #16212b; --surface: #1b2733; --raised: #22303e; --select: #1a3353;
  --line: #26364a; --line-mid: #34465b; --line-strong: #6a7f98;
  --ink-1: #e8eef5; --ink-2: #ccd6e1; --ink-3: #aebbcb; --ink-4: #91a1b4; --ink-off: #6f8094;
  --teal: #3cc4b0; --teal-hover: #5ad6c4; --on-teal: #021714;
  --blue: #3a86d6; --blue-text: #8dbef2; --on-blue: #0b1622; --deep: #1f4f8f;
  --green: #6ccb7e; --amber: #e7b65a; --red: #ff9e99; --red-fill: #d9463e;
  --preview: #d9e2eb;
  --sans: "Mona Sans", "Hind Siliguri", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Hind Siliguri", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--ink-1); font-family: var(--sans); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; }
::selection { background: rgb(31 79 143 / .75); color: #fff; }

header { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-right: auto; }
.brand-tile { display: inline-block; width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #1f4f8f, #3a86d6 40%, #3cc4b0 75%, #6ccb7e); flex: none; }
.brand b { font-size: 16px; font-weight: 600; }
.brand small { color: var(--ink-3); font-size: 13px; border-left: 1px solid var(--line); padding-left: 10px; }

button, .toggle { font: inherit; font-size: 14px; font-weight: 500; min-height: 36px; padding: 6px 14px; border-radius: 6px; border: 0; background: var(--surface); color: var(--ink-1); box-shadow: inset 0 0 0 1px var(--line-mid); cursor: pointer; transition: background-color 120ms cubic-bezier(.2, 0, 0, 1); }
button:hover { background: var(--raised); }
button:active { transform: translateY(1px); }
button:disabled { background: var(--raised); color: var(--ink-off); box-shadow: none; cursor: not-allowed; }
button.primary { background: var(--teal); color: var(--on-teal); box-shadow: none; font-weight: 600; }
button.primary:hover { background: var(--teal-hover); }
button.stop { background: var(--red-fill); color: #fff; box-shadow: none; font-weight: 600; }
button.share-btn { background: var(--surface); color: var(--ink-1); }
button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }
.toggle { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }

main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.editor, .editors { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; min-width: 0; background: var(--sunken); }
.label { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; min-height: 40px; font-size: 13px; font-weight: 500; color: var(--ink-3); background: var(--panel); border-bottom: 1px solid var(--line); }
.label button { padding: 2px 10px; min-height: 28px; font-size: 13px; }
#code { flex: 1; min-height: 0; }
.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-3); padding: 10px 18px; min-height: 44px; }
.tabs button:hover { color: var(--ink-1); background: none; }
.tabs button.on { color: var(--ink-1); box-shadow: inset 0 -2px var(--blue-text); }
.pane { flex: 1; min-height: 0; display: none; }
.pane.on { display: block; }
.preview { display: flex; flex-direction: column; min-height: 0; background: var(--sunken); }
iframe { flex: 1; width: 100%; border: 0; background: var(--preview); color-scheme: light; }

/* CodeMirror 5, theme name stays "dracula" (set in the page scripts); the colours below are the brand syntax theme */
.CodeMirror { height: 100%; font: 400 13.5px/1.7 var(--mono); font-variant-ligatures: none; }
.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters { background: var(--sunken) !important; color: var(--ink-1); }
.cm-s-dracula .CodeMirror-gutters { border-right: 1px solid var(--line); }
.cm-s-dracula .CodeMirror-linenumber { color: var(--ink-off); }
.cm-s-dracula .CodeMirror-cursor { border-left: 2px solid var(--ink-1); }
.cm-s-dracula div.CodeMirror-selected, .cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgb(31 79 143 / .6); }
.cm-s-dracula .CodeMirror-activeline-background { background: rgb(31 79 143 / .3); }
.cm-s-dracula span.cm-keyword, .cm-s-dracula span.cm-atom, .cm-s-dracula span.cm-operator { color: #8dbef2; font-weight: 400; }
.cm-s-dracula span.cm-def, .cm-s-dracula span.cm-variable-2, .cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-builtin, .cm-s-dracula span.cm-tag { color: #5ed3c1; }
.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #8fd89c; }
.cm-s-dracula span.cm-number { color: #e7b65a; }
.cm-s-dracula span.cm-comment { color: #aebbcb; font-style: normal; }
.cm-s-dracula span.cm-attribute, .cm-s-dracula span.cm-property, .cm-s-dracula span.cm-qualifier { color: #b5c8f5; }
.cm-s-dracula span.cm-variable, .cm-s-dracula span.cm-meta { color: #e8eef5; }
.cm-s-dracula span.cm-bracket, .cm-s-dracula span.cm-punctuation { color: #ccd6e1; }
.cm-s-dracula span.cm-error { color: var(--red); background: none; }
.CodeMirror-matchingbracket { color: var(--ink-1) !important; box-shadow: inset 0 -2px var(--blue-text); }
.CodeMirror-hints { background: var(--raised); border: 0; border-radius: 8px; box-shadow: 0 16px 48px -12px rgb(2 8 16 / .6), 0 0 0 1px var(--line); font: 400 13px var(--mono); z-index: 50; }
.CodeMirror-hint { color: var(--ink-1); }
li.CodeMirror-hint-active { background: var(--select); color: var(--ink-1); }

.side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--sunken); }
#stdin { height: 90px; resize: vertical; border: 0; padding: 10px 14px; background: var(--sunken); color: var(--ink-1); font: 400 13.5px/1.6 var(--mono); border-bottom: 1px solid var(--line); }
#stdin::placeholder { color: var(--ink-4); }
pre#out { flex: 1; margin: 0; padding: 12px 14px; overflow: auto; background: var(--sunken); color: var(--ink-1); font: 400 13.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
#out .err { color: var(--red); }
#out .info { color: var(--ink-3); }
#out table { border-collapse: collapse; margin: 4px 0 6px; font-size: 13.5px; }
#out th, #out td { border: 1px solid var(--line); padding: 5px 12px; text-align: left; }
#out th { background: var(--panel); color: var(--ink-1); font-weight: 600; }
#out td { color: var(--ink-1); }
.schema { padding: 10px 14px; font: 400 13px/1.7 var(--mono); color: var(--ink-3); border-bottom: 1px solid var(--line); max-height: 150px; overflow: auto; }
.schema b { color: var(--ink-1); font-weight: 600; }
.tbl { display: block; width: 100%; text-align: left; background: none; box-shadow: none; border: 0; border-radius: 4px; padding: 4px 8px; margin: 0 -8px; font: inherit; color: var(--ink-3); cursor: pointer; min-height: 28px; }
.tbl:hover { background: var(--surface); color: var(--ink-1); }

footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
footer .brand-tile { width: 14px; height: 14px; border-radius: 4px; }
footer a { color: var(--ink-1); text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 0.22em; }
footer a:hover { color: var(--blue-text); }

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; grid-template-rows: 1.2fr 1fr; }
  .editor, .editors { border-right: 0; border-bottom: 1px solid var(--line); }
  .brand small { display: none; }
}
@media (max-width: 600px) {
  header { gap: 6px; padding: 6px 10px; }
  .brand { display: none !important; }
  button { font-size: 13px; padding: 5px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
