 :root {
  --font-size: 18px; --window:#202124; --toolbar:#292A2D; --panel:#2D2F33; --editor:#242529; --console:#25262A; --button:#34363B; --button-hover:#414349; --button-pressed:#2B2D31; --border:#55585F; --text:#F1F3F4; --muted:#B0B3B8; --accent:#36C96B; --tab:#33353A; --tab-selected:#45474D; --selection:rgba(62,95,73,.48); --line-area:#2B2D31; --line-current:#34363B; --console-height:29%;
}
body.theme-light {
  --window:#E9EAEC; --toolbar:#DEDFE2; --panel:#F4F4F5; --editor:#FAFAFA; --console:#F1F1F2; --button:#F7F7F8; --button-hover:#E7E8EA; --button-pressed:#D8D9DC; --border:#B7B9BE; --text:#25262A; --muted:#6E7177; --accent:#168A46; --tab:#D7D8DB; --tab-selected:#FAFAFA; --selection:rgba(211,232,217,.72); --line-area:#E1E2E4; --line-current:#ECEDEF;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--window);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, input { font: inherit; }
button { cursor: pointer; }

#app { height: 100%; display: flex; flex-direction: column; }
.toolbar {
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px;
  background: var(--toolbar);
  border-bottom: 1px solid var(--border);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; min-width: 0; }
.separator { width: 1px; height: 32px; background: var(--border); margin: 0 1px; }
.tool-btn, .small-btn {
  min-height: 40px;
  padding: 3px 11px;
  color: var(--text);
  background: var(--button);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}
.tool-btn { min-width: 88px; }
.tool-btn.compact { min-width: 54px; }
.small-btn { min-height: 34px; font-size: 13px; }
.tool-btn:hover, .small-btn:hover { background: var(--button-hover); border-color: var(--accent); }
.tool-btn:active, .small-btn:active { background: var(--button-pressed); }
.tool-btn:disabled { opacity: .55; cursor: default; }
.language-select, .mode-select {
  min-height: 34px;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--button);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}
.runtime-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.runtime-status.ready { color: var(--accent); }
.runtime-status.error { color: #ff9b9b; }

.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px; }
.editor-panel { flex: 1 1 auto; min-height: 120px; border: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; }
.tabs { display: flex; align-items: end; min-height: 43px; overflow-x: auto; overflow-y: hidden; padding: 0 0 0 0; background: var(--window); }
.tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px 8px 7px 14px;
  margin-right: 3px;
  color: var(--muted);
  background: var(--tab);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  font-size: 15px;
  font-weight: 600;
}
.tab.active { color: var(--text); background: var(--tab-selected); }
.tab:hover { color: var(--text); background: var(--button-hover); }
.tab-close { border: 0; background: transparent; color: var(--muted); font-size: 21px; line-height: 20px; padding: 0 2px; }
.tab-close:hover { color: var(--accent); }

.editor-shell { flex: 1; min-height: 0; display: flex; background: var(--editor); overflow: hidden; }
.line-numbers {
  width: 64px;
  flex: 0 0 64px;
  margin: 0;
  padding: 10px 10px 10px 0;
  overflow: hidden;
  text-align: right;
  user-select: none;
  color: var(--muted);
  background: var(--line-area);
  font: var(--font-size)/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.code-editor { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: var(--editor); }
.highlight, .editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  font: var(--font-size)/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
  white-space: pre;
}
.highlight { z-index: 0; overflow: visible; pointer-events: none; color: var(--text); background: var(--editor); }
.editor {
  z-index: 1;
  flex: 1;
  min-width: 0;
  resize: none;
  outline: none;
  border: 0;
  padding: 10px 12px;
  tab-size: 4;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: transparent;
  caret-color: var(--accent);
  font: var(--font-size)/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
  overflow: auto;
}
/* V0.2.12 — selection translucide : la coloration syntaxique reste lisible.
   Le textarea contient du texte transparent au-dessus du calque de coloration ;
   une selection opaque masquerait donc visuellement le code. */
.editor::selection {
  background: var(--selection);
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.editor::-moz-selection {
  background: var(--selection);
  color: transparent;
}

.splitter { flex: 0 0 6px; cursor: row-resize; background: transparent; position: relative; }
.splitter::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 2px; background: var(--border); }
.console-panel { flex: 0 0 var(--console-height); min-height: 105px; border: 1px solid var(--border); background: var(--console); display: flex; flex-direction: column; }
.console-label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 5px 9px; border-bottom: 1px solid var(--border); background: var(--panel); }
.console-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.console {
  position: absolute; inset: 0;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  outline: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: transparent;
  font: var(--font-size)/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  z-index: 1;
}
.watermark { position: absolute; right: 14px; bottom: 14px; width: 125px; max-height: 80%; object-fit: contain; opacity: .20; pointer-events: none; z-index: 0; }
body.theme-light .watermark { opacity: .13; }

.input-dialog { border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--panel); min-width: min(440px, calc(100vw - 32px)); }
.input-dialog::backdrop { background: rgba(0,0,0,.42); }
.input-dialog form { display: grid; gap: 12px; }
.input-dialog input { width: 100%; padding: 9px 10px; color: var(--text); background: var(--editor); border: 1px solid var(--border); border-radius: 7px; outline: none; }
.input-dialog input:focus { border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions button { padding: 7px 13px; color: var(--text); background: var(--button); border: 1px solid var(--border); border-radius: 7px; }
.dialog-actions .primary { border-color: var(--accent); }

@media (max-width: 820px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { overflow-x: auto; }
  .toolbar-right { justify-content: flex-end; }
  .runtime-status { margin-left: auto; }
  .tool-btn { min-width: 76px; font-size: 14px; }
  .workspace { padding-top: 4px; }
}

/* Python syntax highlighting — exact SerpyCode desktop V1.3 palette */
.tok-keyword { color: #66c7ff; font-weight: 700; }
.tok-builtin { color: #c7a0ff; }
.tok-string { color: #8ee6a4; }
.tok-comment { color: #7f98b8; }
.tok-number { color: #ff9b9b; }
body.theme-light .tok-keyword { color: #006fb9; font-weight: 700; }
body.theme-light .tok-builtin { color: #7048a8; }
body.theme-light .tok-string { color: #16793a; }
body.theme-light .tok-comment { color: #68778d; }
body.theme-light .tok-number { color: #b52a38; }


/* Pygame Web window — SerpyCode Online V0.2 */
.pygame-window {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 90px));
  min-width: 320px;
  min-height: 260px;
  resize: both;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 70px rgba(0,0,0,.5);
  background: #111820;
  display: flex;
  flex-direction: column;
}
.pygame-window[hidden] { display: none; }
.pygame-titlebar {
  flex: 0 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 0 12px;
  color: var(--text);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}
.pygame-actions { display: flex; align-items: center; gap: 10px; }
.pygame-status { color: var(--muted); font-weight: 600; font-size: 12px; }
.pygame-status.ready { color: #65d58a; }
.pygame-status.error { color: #ff8585; }
.pygame-close {
  width: 30px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); background: var(--button);
  font-size: 22px; line-height: 22px;
}
.pygame-close:hover { background: #b23a48; color: white; }
.pygame-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #0b0f14; }
.pygame-frame { width: 100%; height: 100%; border: 0; display: block; background: #0b0f14; }
.pygame-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 520px; padding: 12px 16px; text-align: center;
  color: #b9c9dd; font-size: 13px; line-height: 1.45; pointer-events: none;
}
body.theme-light .pygame-window { box-shadow: 0 20px 60px rgba(20,30,45,.28); }
@media (max-width: 700px) {
  .pygame-window { width: calc(100vw - 12px); height: calc(100vh - 74px); }
  .pygame-status { display: none; }
}

/* Project explorer — SerpyCode Online V0.2.3 */
.editor-body { flex: 1; min-height: 0; display: flex; }
.project-panel {
  flex: 0 0 190px;
  min-width: 150px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.project-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px 5px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-add {
  width: 28px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--button);
  line-height: 22px;
}
.project-add:hover { background: var(--button-hover); border-color: var(--accent); }
.project-files { flex: 1; min-height: 0; overflow: auto; padding: 5px; }
.project-file {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 5px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 13px;
}
button.project-file:hover, .project-file.active { color: var(--text); background: var(--button-hover); }
.project-file.resource { cursor: default; }
.project-icon { flex: 0 0 19px; text-align: center; font-size: 14px; }
.project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-remove { flex: 0 0 23px; width: 23px; height: 23px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 17px; border-radius: 4px; }
.project-remove:hover { color: var(--accent); background: var(--button-hover); }
.editor-body > .editor-shell { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .project-panel { flex-basis: 145px; min-width: 120px; }
}

/* V0.2.6 — collapsible project explorer and tabs limited to code area */
.code-area {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--editor);
}
.code-area > .tabs { flex: 0 0 auto; width: 100%; }
.code-area > .editor-shell { flex: 1 1 auto; min-width: 0; min-height: 0; }
.project-actions { display: flex; align-items: center; gap: 5px; }
.project-toggle {
  width: 28px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--button);
  line-height: 22px;
  font-size: 14px;
}
.project-toggle:hover { background: var(--button-hover); border-color: var(--accent); }
.project-panel.collapsed {
  flex: 0 0 38px;
  min-width: 38px;
  max-width: 38px;
}
.project-panel.collapsed .project-header {
  padding: 5px;
  justify-content: center;
  border-bottom: 0;
}
.project-panel.collapsed #projectLabel,
.project-panel.collapsed #projectAddBtn,
.project-panel.collapsed .project-files { display: none; }
.project-panel.collapsed .project-actions { gap: 0; }
.project-panel.collapsed .project-toggle { width: 28px; }

@media (max-width: 720px) {
  .project-panel.collapsed { flex-basis: 38px; min-width: 38px; }
}


/* V0.2.11 — responsive smartphone/tablet layout */
.tool-btn, .small-btn, .language-select, .mode-select {
  max-width: 100%;
  white-space: nowrap;
}

@supports (height: 100dvh) {
  html, body { height: 100dvh; }
  #app { height: 100dvh; }
}

@media (max-width: 820px) {
  .toolbar {
    min-height: 0;
    padding: 6px;
    gap: 6px;
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar-left,
  .toolbar-right {
    width: 100%;
    min-width: 0;
    overflow: visible;
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar-left { justify-content: flex-start; }
  .toolbar-right { justify-content: flex-end; }
  .separator { display: none; }
  .tool-btn {
    min-width: max-content;
    min-height: 36px;
    padding: 5px 9px;
    font-size: 13px;
    line-height: 1.15;
  }
  .tool-btn.compact {
    min-width: 42px;
    padding-inline: 8px;
  }
  .small-btn,
  .language-select, .mode-select {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 12px;
  }
  .runtime-status {
    margin-left: 0;
    margin-right: auto;
    align-self: center;
    font-size: 11px;
  }
  .workspace {
    padding: 4px;
  }
  .tabs {
    min-height: 38px;
  }
  .tab {
    min-height: 37px;
    padding: 5px 7px 5px 10px;
    font-size: 13px;
  }
  .tab-close {
    font-size: 19px;
  }
  .line-numbers {
    width: 48px;
    flex-basis: 48px;
    padding-right: 7px;
  }
}

@media (max-width: 560px) {
  .toolbar-left {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }
  .toolbar-left .tool-btn {
    width: 100%;
    min-width: 0;
    padding: 5px 4px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toolbar-left #newBtn,
  .toolbar-left #openBtn,
  .toolbar-left #saveBtn,
  .toolbar-left #runBtn {
    grid-column: span 2;
  }
  .toolbar-left #zoomInBtn,
  .toolbar-left #zoomOutBtn {
    grid-column: span 1;
    min-width: 0;
  }
  .toolbar-right {
    gap: 5px;
  }
  .runtime-status {
    flex: 1 1 auto;
    min-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .editor-panel { min-height: 96px; }
  .console-panel { min-height: 90px; }
  .project-panel.collapsed {
    flex: 0 0 34px;
    min-width: 34px;
    max-width: 34px;
  }
  .project-panel.collapsed .project-toggle {
    width: 25px;
  }
  .project-panel:not(.collapsed) {
    flex-basis: min(42vw, 170px);
    min-width: 118px;
    max-width: 170px;
  }
  .project-header {
    padding-inline: 6px;
  }
  .project-file {
    font-size: 12px;
  }
  .watermark {
    width: 90px;
    right: 8px;
    bottom: 8px;
  }
  .pygame-window {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    min-width: 0;
    min-height: 0;
    resize: none;
    border-radius: 7px;
  }
}

@media (max-width: 390px) {
  .toolbar-left .tool-btn {
    font-size: 11px;
    padding-inline: 3px;
  }
  .small-btn, .language-select, .mode-select { font-size: 11px; }
  .line-numbers {
    width: 42px;
    flex-basis: 42px;
    padding-right: 5px;
  }
}

.mode-select { min-height:40px; padding:3px 10px; color:var(--text); background:var(--button); border:1px solid var(--border); border-radius:8px; font-size:15px; font-weight:700; }
.web-preview-window { width:min(1000px,92vw); height:min(760px,88vh); }
/* HTML/CSS syntax highlighting — exact Crocode Editor V1.25 palette */
.tok-tag, .tok-cssprop { color:#66c7ff; }
.tok-tag, .tok-selector, .tok-doctype { font-weight:700; }
.tok-attr, .tok-selector { color:#c7a0ff; }
.tok-doctype { color:#ffcf70; }
body.theme-light .tok-tag, body.theme-light .tok-cssprop { color:#006fb9; }
body.theme-light .tok-attr, body.theme-light .tok-selector { color:#7048a8; }
body.theme-light .tok-doctype { color:#9a6500; }
.project-icon { width:22px; min-width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; }
.project-icon img { width:19px; height:19px; object-fit:contain; display:block; }
.project-generic-icon { font-size:16px; line-height:1; }

/* Crocode V1.11 — sélecteur de langage avec les icônes officielles du projet desktop */
.mode-picker{position:relative;flex:0 0 auto}
.mode-select-hidden{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.mode-button{min-height:40px;padding:4px 10px;display:flex;align-items:center;gap:8px;color:var(--text);background:var(--button);border:1px solid var(--border);border-radius:8px;font-size:15px;font-weight:700;white-space:nowrap}
.mode-button:hover,.mode-menu-item:hover{background:var(--button-hover);border-color:var(--accent)}
.mode-button img,.mode-menu-item img{width:22px;height:22px;object-fit:contain;flex:0 0 22px}
.mode-caret{margin-left:2px;color:var(--muted)}
.mode-menu{position:absolute;z-index:1000;left:0;top:calc(100% + 5px);min-width:170px;padding:5px;background:var(--panel);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.mode-menu-item{width:100%;display:flex;align-items:center;gap:9px;padding:8px 10px;color:var(--text);background:transparent;border:1px solid transparent;border-radius:6px;font-weight:650;text-align:left;white-space:nowrap}
@media(max-width:600px){.mode-button{min-height:36px;font-size:13px;padding:3px 7px}.mode-button img,.mode-menu-item img{width:20px;height:20px;flex-basis:20px}.mode-menu{min-width:150px}}

/* Crocode Online V1.25 — menu Projet et dossiers */
.floating-menu{position:fixed;z-index:120;width:220px;padding:5px;background:var(--panel);border:1px solid var(--border);border-radius:7px;box-shadow:0 10px 30px rgba(0,0,0,.28)}
.floating-menu[hidden]{display:none}.floating-menu button{display:block;width:100%;padding:8px 10px;text-align:left;color:var(--text);background:transparent;border:0;border-radius:5px}.floating-menu button:hover{background:var(--button-hover)}.floating-menu hr{border:0;border-top:1px solid var(--border);margin:4px}
.project-folder{font-weight:650;color:var(--muted)}

/* Crocode Online V1.26 — file drag & drop */
.workspace.file-drag-over {
  outline: 2px dashed var(--accent, #55d5ff);
  outline-offset: -4px;
}

/* Crocode Online V1.30 — icônes de barre identiques au dessin Mac/PC V1.25 */
#newBtn, #openBtn, #saveBtn { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.toolbar-icon { width:22px; height:22px; flex:0 0 22px; fill:none; stroke:currentColor; stroke-width:1.25; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width: 620px) {
  #newBtn, #openBtn, #saveBtn { gap:5px; }
  .toolbar-icon { width:19px; height:19px; flex-basis:19px; }
}

/* V1.35 — Accueil et état inactif, alignés sur Crocode Editor desktop. */
.tool-btn:disabled,
.mode-button:disabled {
  color: #777A80;
  background: #2A2B2F;
  border-color: #3B3D42;
  opacity: 1;
  cursor: default;
}
.tool-btn:disabled:hover,
.mode-button:disabled:hover {
  color: #777A80;
  background: #2A2B2F;
  border-color: #3B3D42;
}
body.theme-light .tool-btn:disabled,
body.theme-light .mode-button:disabled,
body.theme-light .tool-btn:disabled:hover,
body.theme-light .mode-button:disabled:hover {
  color: #9A9CA1;
  background: #E1E2E4;
  border-color: #C9CACE;
}
.mode-button:disabled img { opacity: .45; filter: grayscale(.75); }

.welcome-page {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--editor);
  color: var(--text);
  padding: 60px 70px;
}
.welcome-page[hidden] { display: none !important; }
.welcome-content { width: min(760px, 100%); text-align: center; transform: translateY(-5%); }
.welcome-content h1 { margin: 0 0 10px; font-size: clamp(32px, 4vw, 48px); line-height: 1.1; font-weight: 800; }
.welcome-content p { margin: 0 0 28px; color: var(--muted); font-size: 18px; }
.welcome-choices { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.welcome-choice {
  min-width: 225px;
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
  text-align: center;
  color: var(--text);
  background: var(--button);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
}
.welcome-choice:hover { background: var(--button-hover); border-color: var(--accent); }
.welcome-choice img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 34px; }

/* Public edition: neutral in-app language/file icons; no third-party logo artwork. */
.lang-icon, .file-type-icon { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-weight:800; line-height:1; border:1px solid currentColor; border-radius:6px; color:var(--accent); background:transparent; }
.lang-icon { width:22px; height:22px; flex:0 0 22px; font-size:10px; letter-spacing:-.5px; }
.lang-web { font-size:9px; }
.welcome-lang-icon { width:34px; height:34px; flex-basis:34px; font-size:13px; border-radius:8px; }
.welcome-lang-icon.lang-web { font-size:11px; }
.file-type-icon { width:19px; height:19px; font-size:8px; border-radius:4px; }
.file-type-css { font-size:6.5px; letter-spacing:-.4px; }
.welcome-tab { cursor: default; padding-right: 14px; }
@media (max-width: 600px) {
  .welcome-page { padding: 30px 18px; }
  .welcome-content p { font-size: 16px; }
  .welcome-choice { width: 100%; min-width: 0; }
}

/* V1.35 Public — centrage complet du contenu de l’accueil. */
.welcome-content h1, .welcome-content p { text-align: center; }
.welcome-choice > span:last-child { text-align: center; }

/* V1.35 Public — correctif Accueil : occupe toute la zone d'édition.
   .code-editor restait flex:1 même lorsque textarea/highlight étaient masqués,
   ce qui repoussait l'Accueil dans seulement la moitié gauche de l'éditeur. */
.editor-shell:has(.welcome-page:not([hidden])) .code-editor { display: none; }
.editor-shell:has(.welcome-page:not([hidden])) .welcome-page { flex: 1 1 100%; width: 100%; }

/* V1.36 Public — Accueil centré sur la fenêtre complète, comme l'éditeur desktop.
   Le panneau d'accueil garde son fond dans la zone d'édition, mais son contenu
   est positionné par rapport au viewport plutôt qu'au seul panneau éditeur. */
.welcome-page:not([hidden]) .welcome-content {
  position: fixed;
  left: 50vw;
  top: 50vh;
  width: min(760px, calc(100vw - 48px));
  transform: translate(-50%, -50%);
  z-index: 20;
}
@media (max-width: 600px) {
  .welcome-page:not([hidden]) .welcome-content {
    width: min(760px, calc(100vw - 36px));
  }
}

/* V1.37 — Mobile : boutons Nouveau fichier plus lisibles sans agrandir les icônes. */
@media (max-width: 600px) {
  .welcome-choices {
    width: min(340px, 100%);
    margin: 0 auto;
    gap: 10px;
  }
  .welcome-choice {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 10px 14px;
    gap: 10px;
    justify-content: flex-start;
    font-size: 15px;
  }
  .welcome-choice img {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }
  .welcome-choice > span:last-child {
    flex: 1 1 auto;
    text-align: left;
  }
}

/* V1.38 — Mobile : boutons d'accueil plus petits et moins larges. */
@media (max-width: 600px) {
  .welcome-choices {
    width: auto;
    max-width: none;
    gap: 8px;
    align-items: center;
  }
  .welcome-choice {
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 7px 11px;
    gap: 7px;
    font-size: 13px;
    justify-content: center;
    align-self: center;
  }
  .welcome-choice img {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }
  .welcome-choice > span:last-child {
    flex: 0 1 auto;
    text-align: center;
    white-space: nowrap;
  }
}

/* V1.39 — Mobile : accueil plus compact et remonté, barre principale moins large. */
@media (max-width: 600px) {
  .welcome-page:not([hidden]) .welcome-content {
    top: 43vh;
    width: calc(100vw - 28px);
  }
  .welcome-content h1 {
    font-size: 26px;
    margin-bottom: 7px;
  }
  .welcome-content p {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
  }
  .toolbar-left .tool-btn,
  .toolbar-left #newBtn,
  .toolbar-left #openBtn,
  .toolbar-left #saveBtn,
  .toolbar-left #runBtn,
  .toolbar-left #zoomInBtn,
  .toolbar-left #zoomOutBtn {
    width: auto;
    min-width: 0;
    grid-column: auto;
    min-height: 32px;
    padding: 4px 7px;
    font-size: 11px;
    flex: 0 0 auto;
  }
  .toolbar-left .toolbar-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
  .mode-button {
    min-height: 32px;
    padding: 3px 6px;
    font-size: 11px;
  }
}

/* V1.40 — Mobile : barre supérieure strictement organisée sur 2 lignes. */
@media (max-width: 600px) {
  .toolbar {
    padding: 4px 5px;
    gap: 4px;
  }
  .toolbar-left {
    width: 100%;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: center;
    overflow: hidden;
  }
  .toolbar-left .separator { display: none; }
  .toolbar-left .tool-btn,
  .toolbar-left #newBtn,
  .toolbar-left #openBtn,
  .toolbar-left #saveBtn,
  .toolbar-left #runBtn,
  .toolbar-left #zoomInBtn,
  .toolbar-left #zoomOutBtn {
    min-height: 29px;
    padding: 2px 3px;
    font-size: 9px;
    gap: 2px;
    flex: 0 1 auto;
    white-space: nowrap;
  }
  .toolbar-left #zoomInBtn,
  .toolbar-left #zoomOutBtn { min-width: 27px; }
  .toolbar-left .toolbar-icon {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
  }
  .mode-picker { flex: 0 1 auto; min-width: 0; }
  .mode-button {
    min-height: 29px;
    padding: 2px 3px;
    font-size: 9px;
    gap: 2px;
    white-space: nowrap;
  }
  .mode-button img {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
  .mode-caret { font-size: 8px; }

  .toolbar-right {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    overflow: hidden;
  }
  .runtime-status {
    margin: 0;
    flex: 0 1 auto;
    font-size: 10px;
  }
  .toolbar-right .small-btn,
  .toolbar-right .language-select {
    min-height: 28px;
    padding: 2px 6px;
    font-size: 10px;
    flex: 0 0 auto;
  }
}
