* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #FAFAFA;
  color: #212121;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* padding-top hält Abstand zum fixierten Abmelden-Button */
.container { text-align: center; padding: 72px 24px 24px; width: 100%; max-width: 560px; }

#word-display {
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: 32px;
  min-height: 2.4rem;
  overflow-wrap: anywhere;
}

.subtitle { font-size: 1.1rem; margin-bottom: 20px; }

.tree { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-bottom: 32px; }
.row { display: flex; gap: 8px; justify-content: center; }

button { border: none; cursor: pointer; font: inherit; }

.len {
  width: 52px;
  height: 38px;
  border-radius: 19px;
  font-weight: 600;
  color: #212121;
  transition: background-color .15s, color .15s, transform .05s;
}
.len:active { transform: scale(.96); }
.len.mehr { width: 90px; }

/* Reihenfarben: hell (inaktiv) → kräftig (gewählt); Werte aus der Android-App */
.purple { background: #B39DDB; }  .purple.selected { background: #673AB7; color: #fff; }
.blue   { background: #90CAF9; }  .blue.selected   { background: #1976D2; color: #fff; }
.green  { background: #A5D6A7; }  .green.selected  { background: #388E3C; color: #fff; }
.yellow { background: #FFF59D; }  .yellow.selected { background: #FBC02D; color: #000; }
.orange { background: #FFCC80; }  .orange.selected { background: #F57C00; color: #fff; }
.red    { background: #EF9A9A; }  .red.selected    { background: #D32F2F; color: #fff; }

.controls { display: flex; gap: 16px; justify-content: center; align-items: center; }

.arrow {
  width: 52px;
  height: 42px;
  border-radius: 21px;
  background: #9E9E9E;
  color: #fff;
  font-size: 1.2rem;
}
.arrow:disabled { background: #E0E0E0; color: #9E9E9E; cursor: default; }

.generate {
  background: #673AB7;
  color: #fff;
  padding: 0 24px;
  height: 42px;
  border-radius: 21px;
  font-weight: 600;
}
.generate:disabled { opacity: .7; cursor: wait; }

.logout {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #EEE;
  color: #424242;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: .9rem;
}
.logout:hover { background: #E0E0E0; }

/* Sprachumschalter */
.lang-switch {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 4px;
  background: #EEE;
  border-radius: 18px;
  padding: 4px;
}
.lang-switch button {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: .85rem;
  font-weight: 600;
  background: none;
  color: #757575;
}
.lang-switch button.active {
  background: #673AB7;
  color: #fff;
}

/* Verlauf */
.history-section { margin-top: 28px; }

.history-toggle {
  background: #EEE;
  color: #424242;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: .9rem;
}
.history-toggle:hover { background: #E0E0E0; }

.history-panel {
  margin: 16px auto 0;
  max-width: 340px;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: .85rem;
  color: #757575;
}

.history-clear {
  background: none;
  color: #D32F2F;
  font-size: .85rem;
  padding: 4px 8px;
  border-radius: 8px;
}
.history-clear:hover { background: #FCEBEB; }
.history-clear:disabled { color: #BDBDBD; cursor: default; background: none; }

.history-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}
.history-list li {
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.history-list li:hover { background: #F5F5F5; }
.history-list li.current {
  background: #EDE7F6;
  color: #673AB7;
  font-weight: 600;
}

/* Login-Seite */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  width: 100%;
  max-width: 380px;
  margin: 24px;
  text-align: center;
}
.card h1 { font-size: 1.4rem; margin-bottom: 20px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  background: #EEE;
  color: #424242;
  font-weight: 600;
}
.tab.active { background: #673AB7; color: #fff; }

.card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #DDD;
  border-radius: 12px;
  font: inherit;
}
.card .submit {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #673AB7;
  color: #fff;
  font-weight: 600;
}

.msg { margin-top: 12px; font-size: .9rem; min-height: 1.2em; }
.msg.error { color: #D32F2F; }
