:root {
  --primary: #9b59b6;
  --primary-soft: #eec8fd;
  --accent: #9b59b6;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --success: #16a34a;
  --shadow-soft:
    9px 9px 16px rgba(163, 177, 198, 0.6),
    -9px -9px 16px rgba(255, 255, 255, 0.5);

  --shadow-inset:
    inset 6px 6px 12px rgba(163, 177, 198, 0.5),
    inset -6px -6px 12px rgba(255, 255, 255, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 30px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Titelbereich */
.page-header {
  text-align: center;
  margin-bottom: 30px;
}

.page-header h1 {
  margin: 0;
}

.page-header p {
  opacity: .7;
  margin-top: 6px;
}

/* Kartenlayout */
.card {
  background: var(--bg);
  border-radius: 30px;
  padding: 30px;

  width: 100%;
  max-width: 750px;

  box-shadow: var(--shadow-soft);
  margin-bottom: 30px;
}

.card:hover {
  transform: translateY(-0px);
}

/* Buttons */
.Q-button,
.measurement-history-action-button {
  margin-top: 20px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.Q-button:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

.measurement-history-action-button:hover {
  opacity: 0.85;
  transform: scale(1.03);
  color: var(--primary);
}

/* Messungsverlauf */
.measurement-history-container {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 750px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.measurement-history-container h2 {
  margin-top: 0;
}

.measurement-history-container-element {
  background: var(--card-light);
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  border-left: 4px solid var(--success);
  animation: fadeIn 0.3s ease;
  justify-content: space-between;
  display: flex;
}

.measurement-list {
  margin-top: 15px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Circuit Anpassung */
#circuit-X {
  margin-top: 20px;
}

/* Palette optisch etwas aufwerten */
.Q-circuit-palette {
  margin-bottom: 25px;
  padding: 15px;

  background: var(--bg);
  border-radius: 20px;
  box-shadow: var(--shadow-inset);

  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* --- ENTFERNEN DES KONSOLEN-TEXTES UNTER DEM SCHALTKREIS --- */
#circuit-X p {
  display: none !important;
}

.Q-circuit+p {
  display: none !important;
}


/* Responsive */
@media (max-width: 768px) {

  .card,
  .measurement-history-container {
    padding: 20px;
  }
}

/* Header mit Titel + Reset */
.measurement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.measurement-header h2 {
  margin: 0;
}

/* Reset-Button etwas kompakter */
.measurement-history-action-button {
  margin-top: 0;
  /* wichtig: entfernt alten Abstand */
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* Styling der Wahrscheinlichkeits-Anzeige */
.probability-item {
  display: flex;
  align-items: center;
  margin-bottom: 0px;
  font-family: monospace;
  font-weight: bold;
}

.probability-label {
  width: 60px;
  color: var(--primary);
}

.probability-bar-wrapper {
  flex: 1;
  background: #f1f5f9;
  height: 18px;
  border-radius: 9px;
  margin: 0 15px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.probability-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.probability-value {
  width: 50px;
  text-align: right;
  color: var(--muted);
}


#playground-report {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 15px;
  box-shadow: var(--shadow-inset);
  font-family: 'Segoe UI', monospace;
  font-size: 0.8rem;
  color: var(--text-color);
  white-space: pre-wrap;
  display: block;
}

/* Wahrscheinlichkeiten */
.measurement-history-container {
  background: var(--bg);
  border-radius: 30px;
  padding: 25px;

  width: 100%;
  max-width: 750px;

  box-shadow: var(--shadow-soft);
}

.measurement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.measurement-header h2 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--text);
}

.measurement-history-action-button {
  background: none;
  border: 1px solid #cbd5e1;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
}

.measurement-list {
  margin-top: 10px;
  max-height: 150px;
  overflow-y: auto;

  padding: 10px;

  background: var(--bg);
  border-radius: 15px;

  box-shadow: var(--shadow-inset);
}

.measurement-history-container-element {
  padding: 12px 15px;
  margin-bottom: 10px;

  background: var(--bg);
  border-radius: 10px;

  box-shadow: var(--shadow-soft);

  display: flex;
  justify-content: space-between;

  font-family: monospace;

  border-left: 4px solid var(--success);
}