* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #46178f 0%, #250858 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.container {
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

/* Screen Management */
.screen {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 20px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  letter-spacing: 2px;
}

/* Karten & Formulare */
.card {
  background: #ffffff;
  color: #333333;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  margin: 0 auto 20px auto;
}

.card h2 {
  margin-bottom: 18px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 14px;
  border: 2px solid #cccccc;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  font-weight: bold;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #46178f;
  outline: none;
}

/* Buttons */
.btn {
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.small-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.primary-btn {
  background-color: #333333;
  color: #ffffff;
  width: 100%;
}

.secondary-btn {
  background-color: #0582ca;
  color: #ffffff;
}

.success-btn {
  background-color: #26890c;
  color: #ffffff;
}

.warning-btn {
  background-color: #e67e22;
  color: #ffffff;
}

.cancel-btn {
  background-color: #7f8c8d;
  color: #ffffff;
}

.host-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 450px;
  margin: 0 auto;
}

.divider {
  margin: 20px 0;
  font-weight: bold;
  opacity: 0.8;
}

/* ==========================================
   GESPEICHERTE QUIZZE & EDITOR STYLES
   ========================================== */
.saved-quizzes-card {
  max-width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.saved-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.saved-header h2 {
  margin-bottom: 0;
}

.saved-quizzes-list {
  list-style: none;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  background: #f8f9fa;
}

.saved-quiz-item {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-left: 5px solid #0582ca;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.saved-quiz-item:last-child {
  margin-bottom: 0;
}

.saved-quiz-info {
  flex: 1;
  min-width: 200px;
}

.saved-quiz-title {
  font-weight: bold;
  font-size: 1.05rem;
  color: #222;
}

.saved-quiz-meta {
  font-size: 0.85rem;
  color: #666;
}

.saved-quiz-actions {
  display: flex;
  gap: 8px;
}

.creator-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.creator-card {
  max-width: 100%;
  margin: 0;
  text-align: left;
}

.creator-card h2 {
  text-align: center;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: #222;
}

.form-group input {
  text-align: left;
  margin-bottom: 5px;
}

.creator-hint {
  font-size: 0.92rem;
  color: #555;
  margin-bottom: 12px;
}

.answer-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 8px;
  background: #f9f9fb;
}

.answer-input-row input[type="text"] {
  margin-bottom: 0;
  text-align: left;
  flex: 1;
  padding: 10px;
}

.shape-badge {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background: #eee;
  user-select: none;
  flex-shrink: 0;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #26890c;
}

.time-limit-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  margin-bottom: 18px;
}

.time-limit-group label {
  margin-bottom: 0;
}

.time-limit-group input[type="number"] {
  width: 100px;
  margin-bottom: 0;
  text-align: center;
}

.questions-header-row {
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #444;
}

.created-list {
  list-style: none;
  max-height: 290px;
  overflow-y: auto;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.empty-list-hint {
  color: #777;
  text-align: center;
  padding: 20px 10px;
  font-style: italic;
}

.created-question-item {
  background: #ffffff;
  border: 1px solid #ddd;
  border-left: 5px solid #46178f;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s, border-color 0.2s;
}

.created-question-item.editing-active {
  background: #fff8e7;
  border-color: #e67e22;
  border-left: 5px solid #e67e22;
}

.created-q-info {
  flex: 1;
}

.created-q-title {
  font-weight: bold;
  font-size: 0.98rem;
  color: #222;
  margin-bottom: 4px;
}

.created-q-meta {
  font-size: 0.85rem;
  color: #26890c;
  font-weight: 600;
}

.item-action-btns {
  display: flex;
  gap: 6px;
}

.btn-small-action {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.82rem;
  color: #fff;
}

.btn-small-action:hover {
  opacity: 0.9;
}

.btn-edit-q {
  background: #0582ca;
}

.btn-delete-q {
  background: #e21b3c;
}

.btn-play-q {
  background: #26890c;
}

.save-status-msg {
  min-height: 22px;
  font-weight: bold;
  font-size: 0.95rem;
  color: #26890c;
  text-align: center;
  margin-bottom: 8px;
}

/* Host Lobby */
.pin-banner {
  background: #ffffff;
  color: #250858;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.pin-banner p {
  font-size: 1.2rem;
  font-weight: 600;
}

.pin-banner h1 {
  font-size: 4.5rem;
  letter-spacing: 6px;
  font-weight: 900;
}

.lobby-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.player-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.player-grid li {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Host Frage-Ansicht */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.badge {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 1.1rem;
}

.timer-circle {
  width: 70px;
  height: 70px;
  background: #ffffff;
  color: #46178f;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.question-box {
  background: #ffffff;
  color: #222222;
  padding: 40px 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.question-box h1 {
  font-size: 2.2rem;
}

/* Kahoot-Farben für Antworten */
.color-0 { background-color: #e21b3c; } /* Rot */
.color-1 { background-color: #1368ce; } /* Blau */
.color-2 { background-color: #d89e00; } /* Gelb */
.color-3 { background-color: #26890c; } /* Grün */

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.answer-card {
  padding: 30px 20px;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  text-align: left;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.shape {
  font-size: 2rem;
  margin-right: 18px;
  display: inline-block;
}

/* Spieler Antwort-Buttons */
.player-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  height: 75vh;
}

.player-ans-btn {
  border: none;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.1s;
}

.player-ans-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.shape-large {
  font-size: 4.5rem;
}

/* Auswertung & Balkendiagramm */
.correct-answer-banner {
  background: #26890c;
  padding: 15px;
  border-radius: 8px;
  font-size: 1.4rem;
  margin: 15px auto 25px auto;
  max-width: 600px;
}

.stats-bars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 25px;
  height: 160px;
  margin-bottom: 30px;
  padding-top: 20px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 65px;
}

.bar {
  width: 100%;
  min-height: 28px;
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  transition: height 0.5s ease;
}

.shape-label {
  margin-top: 8px;
  font-size: 1.4rem;
}

/* Rangliste */
.leaderboard-card {
  max-width: 550px;
}

.leaderboard-list {
  list-style: none;
  margin-top: 15px;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 8px;
  background: #f4f4f6;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Spieler Status-Karten & Feedback */
.status-card h1 {
  margin-bottom: 15px;
}

.feedback-correct {
  background-color: #26890c !important;
  color: #ffffff !important;
}

.feedback-wrong {
  background-color: #e21b3c !important;
  color: #ffffff !important;
}

.points-badge {
  font-size: 1.8rem;
  font-weight: 900;
  margin: 15px 0;
}

.total-score-display {
  font-size: 1.3rem;
  margin-top: 15px;
}

hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  margin: 15px 0;
}

/* Lade-Animation */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #46178f;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 25px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsives Design */
@media (max-width: 850px) {
  .creator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }
  .logo {
    font-size: 2.3rem;
  }
  .pin-banner h1 {
    font-size: 3rem;
  }
  .question-box h1 {
    font-size: 1.5rem;
  }
}