html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #080c08; 
    color: #DFDFDF;
    display: flex;
    flex-direction: column;
  }

  :root {
    --ide-border: rgba(127, 176, 105, 0.15);
    --ide-bg-sidebar: rgba(10, 14, 10, 0.98);
    --ide-bg-main: rgba(14, 20, 14, 0.95);
    --ide-bg-console: rgba(6, 9, 6, 0.98);
    --ide-hover: rgba(255, 255, 255, 0.05);
    --ide-active: rgba(127, 176, 105, 0.1);
    --bug-color: #e8c547;
    --chal-color: #7fb069;
  }

  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

  .ide-layout {
    display: flex;
    flex: 1;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
    /* Etwas Platz oben für die schwebende DevBar */
    padding-top: 80px; 
    box-sizing: border-box;
  }

  /* --- LEFT SIDEBAR --- */
  .sidebar-left {
    width: 260px;
    flex-shrink: 0;
    background: var(--ide-bg-sidebar);
    border-right: 1px solid var(--ide-border);
    border-top: 1px solid var(--ide-border);
    border-top-right-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    margin-left: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }

  .nav-header {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 20px 20px 10px 20px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .explorer {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
  }

  .category-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--paper-dim);
    text-align: left;
    padding: 8px 20px;
    font-family: var(--mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
  }
  .category-btn:hover { background: var(--ide-hover); color: #fff; }
  .category-icon { font-size: 1rem; width: 20px; text-align: center; }
  .category-chevron { margin-left: auto; font-size: 0.7rem; opacity: 0.5; transition: transform 0.2s; }
  .category-item.open .category-chevron { transform: rotate(90deg); }
  
  .task-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0,0,0,0.2);
  }
  .category-item.open .task-list { display: block; }
  
  .task-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    text-align: left;
    padding: 8px 20px 8px 48px;
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .task-btn:hover { color: #fff; background: rgba(255,255,255,0.02); }
  .task-btn.active { color: var(--leaf); background: var(--ide-active); border-left-color: var(--leaf); }
  .task-btn .status { margin-right: 6px; font-size: 0.7rem; }
  .task-btn.solved { color: rgba(255,255,255,0.4); }
  .task-btn.solved.active { color: var(--leaf); }

  .user-stats {
    padding: 15px 20px;
    border-top: 1px solid var(--ide-border);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--leaf);
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
  }

  /* --- MIDDLE WORKSPACE --- */
  .workspace-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ide-bg-main);
    border-top: 1px solid var(--ide-border);
    margin-bottom: 20px;
    min-width: 0;
  }

  .placeholder-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-family: var(--mono);
    font-size: 0.9rem;
  }
  .placeholder-screen .icon { font-size: 3rem; margin-bottom: 20px; opacity: 0.5; }

  .workspace-inner {
    display: none;
    flex-direction: column;
    height: 100%;
  }

  .task-header-area {
    padding: 20px 30px;
    border-bottom: 1px solid var(--ide-border);
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
  }
  .task-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
  .task-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; margin: 0; color: #fff; }
  
  .badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
  }
  .badge.easy { color: var(--leaf); border: 1px solid var(--leaf); background: rgba(127, 176, 105, 0.1); }
  .badge.medium { color: var(--bug-color); border: 1px solid var(--bug-color); background: rgba(232, 197, 71, 0.1); }
  .badge.xp { color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2); }

  .task-desc { font-size: 0.9rem; line-height: 1.6; color: #CCC; margin: 10px 0; }
  .task-example {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-left: 2px solid var(--leaf);
    margin: 0;
    white-space: pre-wrap;
  }

  /* Editor */
  .editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    overflow: hidden;
  }
  .editor-tabs {
    height: 35px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ide-border);
  }
  .editor-tab {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--leaf);
    border-top: 2px solid var(--leaf);
    background: rgba(255,255,255,0.03);
    gap: 8px;
  }
  
  .editor-core {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
  }
  .editor-lines {
    width: 40px;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid var(--ide-border);
    padding: 15px 0;
    text-align: right;
    padding-right: 12px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.2);
    user-select: none;
    line-height: 1.6;
    overflow: hidden;
  }
  .editor-textarea {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: #E8E8E8;
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 15px;
    line-height: 1.6;
    tab-size: 4;
    caret-color: var(--leaf);
    white-space: pre;
    overflow: auto;
  }
  .editor-textarea::selection { background: rgba(127, 176, 105, 0.3); }

  .editor-actions {
    height: 50px;
    border-top: 1px solid var(--ide-border);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
  }
  .action-btn {
    border: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
  }
  .action-btn:hover { opacity: 0.8; }
  .btn-ghost { background: transparent; border: 1px solid var(--ide-border); color: #fff; }
  .btn-run { background: var(--leaf); color: #000; }
  .btn-bug { background: var(--bug-color); color: #000; }
  .btn-next { background: #fff; color: #000; display: none; }

  /* --- RIGHT SIDEBAR --- */
  .sidebar-right {
    width: 320px;
    flex-shrink: 0;
    background: var(--ide-bg-console);
    border-left: 1px solid var(--ide-border);
    border-top: 1px solid var(--ide-border);
    border-top-left-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    margin-right: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }
  .console-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--ide-border);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
  }
  .console-body {
    flex: 1;
    padding: 15px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--paper-dim);
    overflow-y: auto;
    word-wrap: break-word;
  }
  
  .log-line { margin-bottom: 8px; line-height: 1.4; }
  .log-sys { color: rgba(255,255,255,0.4); }
  .log-success { color: var(--leaf); }
  .log-error { color: #ff6b6b; }
  .log-test { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); padding: 8px; margin-top: 6px; border-radius: 4px; }
  .log-test.pass { border-left: 2px solid var(--leaf); }
  .log-test.fail { border-left: 2px solid #ff6b6b; }