/* Mikrocontroller — same look as the itgrocks start page:
   green stage, cream frame with yellow border and black outline. */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #161616;
  background:
    radial-gradient(circle at 20% 10%, #3f7a45 0, transparent 42%),
    radial-gradient(circle at 90% 90%, #1a4a28 0, transparent 40%),
    #1b3d22;
  font-size: 16px;
}
[hidden] { display: none !important; }
.buehne { min-height: 100vh; padding: 20px 16px; display: flex; justify-content: center; align-items: flex-start; }
.buehne.mitte { align-items: center; }
.rahmen {
  width: min(1400px, 100%);
  background: #f6f1e4;
  border: 10px solid #f4d35e;
  outline: 4px solid #111;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 24px 28px 28px;
}
.rahmen.schmal { width: min(520px, 100%); padding: 36px 36px 32px; }
.kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }
h1 { margin: 6px 0 20px; font-size: clamp(34px, 5vw, 56px); line-height: 0.95; letter-spacing: -0.03em; }
h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -0.01em; }
a { color: #111; }

.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kopf h1 { margin-bottom: 0; }
.kopf .rechts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

button, .knopf {
  font: inherit; font-weight: 700; cursor: pointer;
  background: #f7f7f2; color: #111;
  border: 3px solid #111; padding: 8px 14px;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.gelb { background: #f4d35e; }
button.schwarz { background: #111; color: #f6f1e4; }
button.klein { padding: 3px 8px; border-width: 2px; font-size: 14px; }
button.link { background: none; border: none; padding: 0; text-decoration: underline; font-weight: 600; }

input, select, textarea { font: inherit; }
input[type=text], input[type=password], select {
  border: 2px solid #111; padding: 7px 9px; background: #fff; min-width: 0;
}
label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
.feld { width: 100%; }

.reiter { display: flex; gap: 0; margin-bottom: 18px; }
.reiter button { flex: 1; border-width: 3px; }
.reiter button + button { border-left: 0; }
.reiter button.aktiv { background: #111; color: #f6f1e4; }

.meldung { margin: 12px 0 0; padding: 10px 12px; border: 2px solid #111; background: #fff; font-weight: 600; }
.meldung.fehler { background: #ffd9d2; }
.meldung.ok { background: #d9f2d0; }
.leise { opacity: 0.7; font-size: 14px; }
.marke {
  display: inline-block; padding: 4px 10px; border: 2px solid #111; font-weight: 800; background: #fff;
}
.marke.gelb { background: #f4d35e; }

/* --- student layout --- */
.schueler { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.liste { border: 3px solid #111; background: #fff; padding: 12px; align-self: start; }
.liste ul { list-style: none; padding: 0; margin: 0 0 12px; max-height: 50vh; overflow: auto; }
.liste li button {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid #ddd; background: none;
  padding: 8px 6px; font-weight: 600;
}
.liste li button.aktiv { background: #f4d35e; }
.liste li .zeit { display: block; font-size: 12px; font-weight: 400; opacity: 0.7; }
.neu { display: grid; gap: 6px; }

.arbeit { min-width: 0; }
.arbeit-kopf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.arbeit-kopf input { font-weight: 700; font-size: 18px; flex: 1; min-width: 160px; }
.knoepfe { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; align-items: center; }

/* --- editor --- */
.editor {
  display: flex; border: 3px solid #111; background: #fffdf7; height: 56vh; min-height: 280px;
  font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 15px; line-height: 1.5;
}
.editor .nummern {
  margin: 0; padding: 10px 8px 10px 4px; min-width: 3.4em; text-align: right; color: #888;
  background: #efe8d6; border-right: 2px solid #111; overflow: hidden; user-select: none; white-space: pre;
  font: inherit;
}
.editor .nummern .err { color: #b3261e; font-weight: 800; }
.editor textarea, .editor pre.code {
  flex: 1; margin: 0; padding: 10px 12px; border: 0; resize: none; outline: none; background: transparent;
  font: inherit; color: #161616; white-space: pre; overflow: auto; tab-size: 2;
}
.editor pre.code { user-select: text; }

.status {
  border: 3px solid #111; background: #fff; padding: 12px 14px; margin-top: 4px;
}
.status .titel { font-weight: 800; font-size: 18px; }
.status.laeuft { background: #fff7d1; }
.status.gut { background: #d9f2d0; }
.status.schlecht { background: #ffd9d2; }
.status pre {
  margin: 10px 0 0; max-height: 30vh; overflow: auto; background: #111; color: #f6f1e4; padding: 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap;
}
.status .zeilen { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* --- teacher layout --- */
.leiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.leiste .trenner { flex: 1; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.board { border: 3px solid #111; background: #fff; padding: 10px; display: grid; gap: 4px; }
.board .nr { font-size: 34px; font-weight: 900; line-height: 1; display: flex; justify-content: space-between; align-items: center; }
.board .punkt { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #111; background: #ccc; }
.board .punkt.an { background: #3fb950; }
.board .wer { font-weight: 700; min-height: 1.3em; }
.board.pause { background: #fff0c2; }

.lehrer { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(420px, 1.2fr); gap: 20px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 3px solid #111; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #ddd; vertical-align: middle; font-size: 15px; }
th { background: #111; color: #f6f1e4; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; }
tr.gewaehlt td { background: #fff3b8; }
tr.klickbar { cursor: pointer; }
td select { padding: 3px 4px; }
.st-failed { color: #b3261e; font-weight: 700; }
.st-done { color: #1f6f2c; font-weight: 700; }
.st-running, .st-queued { color: #8a6100; font-weight: 700; }

.detail { border: 3px solid #111; background: #fff; padding: 12px; align-self: start; position: sticky; top: 12px; }
.detail .editor { height: 52vh; }
.versionen { max-height: 20vh; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; border-top: 2px solid #111; }
.versionen li button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid #ddd; background: none; padding: 5px 4px; font-weight: 500; font-size: 14px; }
.versionen li button.aktiv { background: #f4d35e; }
.hinweis-alt { background: #f4d35e; border: 2px solid #111; padding: 6px 10px; margin-bottom: 8px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

dialog { border: 4px solid #111; background: #f6f1e4; padding: 22px; max-width: 420px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.passwort-anzeige { font-family: "SF Mono", Menlo, monospace; font-size: 28px; font-weight: 800; letter-spacing: 0.1em; background: #fff; border: 2px solid #111; padding: 8px 12px; text-align: center; }

@media (max-width: 1000px) {
  .lehrer { grid-template-columns: 1fr; }
  .detail { position: static; }
}
@media (max-width: 760px) {
  .rahmen { padding: 18px 14px; border-width: 6px; }
  .schueler { grid-template-columns: 1fr; }
  .editor { height: 50vh; font-size: 14px; }
}

/* --- files (tabs) --- */
.dateien { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: -3px; }
.reiterleiste { display: flex; gap: 0; flex-wrap: wrap; }
.reiterleiste button {
  border: 3px solid #111; border-bottom: 0; background: #efe8d6; padding: 6px 12px; font-weight: 700;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 14px;
}
.reiterleiste button + button { border-left: 0; }
.reiterleiste button.aktiv { background: #fffdf7; }
.reiterleiste button.notiz { font-style: italic; }
.reiterleiste button.ungespeichert::after { content: " •"; }
.dateien .klein { margin-bottom: 4px; }
.notiz-hinweis { margin: 6px 0 0; }

/* --- teacher settings --- */
.einstellungen { border: 3px solid #111; background: #fff; padding: 14px; margin-bottom: 18px; }
.einst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.einst-box h3 { margin: 0 0 6px; font-size: 16px; }
.einst-box table { border-width: 2px; }

/* --- Klassen (Lehrkraft) --- */
.klassenleiste { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.klassenleiste button {
  border: 3px solid #111; background: #efe8d6; padding: 7px 14px; font-weight: 800; margin: 0 -3px 6px 0;
}
.klassenleiste button.aktiv { background: #111; color: #f6f1e4; }
.klassenleiste button.neu { background: #fff; margin-left: 12px; }
.klassenleiste .frei { color: #1f6f2c; }
.klassenleiste button.aktiv .frei { color: #8fe38f; }
.klasse { border: 3px solid #111; background: #fff; padding: 14px; margin-bottom: 18px; }
.klasse h3 { margin: 14px 0 6px; font-size: 16px; }
.klasse .einst-box h3 { margin-top: 0; }
.klasse table { border-width: 2px; }
.schalter { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-weight: 700; }
.schalter input { width: 20px; height: 20px; }

/* --- gemeinsame Projekte --- */
button.breit { width: 100%; margin-bottom: 10px; }
.einladungen { border: 2px solid #111; background: #fff7d1; padding: 8px; margin-bottom: 10px; }
.einladungen h2 { font-size: 15px; margin: 0 0 6px; }
.einladungen ul { margin: 0; max-height: 28vh; }
.einladungen li { padding: 6px 0; border-bottom: 1px solid #ddd; }
.einladungen li .knoepfe { margin: 4px 0 0; }
.plakette { display: inline-block; min-width: 1.4em; text-align: center; background: #b3261e; color: #fff; border-radius: 10px; padding: 0 6px; font-size: 13px; }
.kenn { display: inline-block; font-size: 11px; font-weight: 700; border: 1px solid #111; background: #f4d35e; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.teilen { border: 2px solid #111; background: #fff; padding: 6px 10px; margin-bottom: 10px; }
.teilen-zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.mitglieder { list-style: none; margin: 4px 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.mitglieder li { border: 2px solid #111; padding: 2px 8px; font-weight: 600; display: flex; gap: 6px; align-items: center; background: #fffdf7; }
.mitglieder li.offen { border-style: dashed; opacity: 0.8; }
.konflikt { background: #ffd9d2; border: 3px solid #111; padding: 8px 12px; margin-bottom: 8px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.versionen .autor { opacity: 0.7; }
.liste .einladungen li .knoepfe { display: flex; gap: 6px; margin: 4px 0 0; }
.liste .einladungen li button { width: auto; text-align: center; border: 2px solid #111; padding: 3px 8px; font-size: 14px; background: #f7f7f2; }
.liste .einladungen li button.gelb { background: #f4d35e; }
.liste li button .kenn { float: right; }
