body {
  background: #f5f5f5;
}

/* Auswahl-Karten für Memory-Sets */
.memory-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  cursor: pointer;
  border: none;
  text-align: left;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.memory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.memory-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #2f3542;
  margin-bottom: 12px;
}

.memory-card__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.memory-card__badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--pg-primary);
  color: white;
}

.memory-card__badge--fach-informatik {
  background: #2ecc71;
}

/* "Eigene Datei laden" */
.skt-link-btn {
  background: none;
  border: none;
  color: #777;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 10px;
}

.rm-upload-area {
  margin-top: 16px;
  border: 2px dashed var(--pg-primary);
  padding: 24px;
  border-radius: 10px;
  background: #e8edff;
  text-align: center;
  width: 100%;
  max-width: 480px;
  cursor: pointer;
}

.rm-upload-area.dragover {
  background: #d0e2ff;
}

/* Spiel-Layout */
.rm-layout {
  flex: 1;
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
}

.rm-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rm-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rm-team {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rm-team__turn {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pg-gold);
  visibility: hidden;
  margin-bottom: 4px;
}

.rm-team--active {
  border-color: var(--pg-gold);
  box-shadow: 0 0 0 4px rgba(255, 210, 74, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rm-team--active .rm-team__turn {
  visibility: visible;
}

.rm-team__name {
  font-weight: 600;
  color: #2f3542;
  margin-bottom: 6px;
}

.rm-team__score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--pg-primary);
}

.rm-status {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.rm-board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-content: start;
  max-width: 560px;
  margin: 0 auto;
}

/* Karten */
.rm-card {
  aspect-ratio: 1;
  perspective: 800px;
  cursor: pointer;
}

.rm-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s;
  transform-style: preserve-3d;
}

.rm-card.flipped .rm-card-inner {
  transform: rotateY(180deg);
}

.rm-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.rm-card-front {
  background: linear-gradient(135deg, var(--pg-primary), #6f8cff);
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
}

.rm-card-back {
  background: white;
  color: #2f3542;
  transform: rotateY(180deg);
  font-weight: 600;
}

.rm-card.matched {
  cursor: default;
  opacity: 0.35;
}

.rm-card.wrong .rm-card-back {
  background: #ffe9e9;
  box-shadow: 0 0 0 3px var(--pg-fail);
}
